Parent

Methods

Rubyipmi::Freeipmi::FruData

Public Class Methods

new(data) click to toggle source
# File lib/rubyipmi/freeipmi/commands/fru.rb, line 122
def initialize(data)
  parse(data)
end

Public Instance Methods

name() click to toggle source
# File lib/rubyipmi/freeipmi/commands/fru.rb, line 118
def name
  self[:name]
end
parse(data) click to toggle source

parse the fru information that should be an array of lines

# File lib/rubyipmi/freeipmi/commands/fru.rb, line 127
def parse(data)
  if ! data.nil?
    data.each do |line|
      key, value = line.split(':', 2)
      if key =~ /^FRU.*/
        if value =~ /([\w\s]*)\(.*\)/
          self[:name] = $~[1].strip.gsub(/\ /, '_').downcase
        end
      else
        key = key.strip.gsub(/\ /, '_').downcase.gsub(/fru_/, '')
        if ! value.nil?
          self[key] = value.strip

        end
      end
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.