class IbmPowerHmc::HmcObject

HMC generic object

Attributes

uuid[R]

Public Class Methods

new(doc) click to toggle source
# File lib/ibm_power_hmc/objects.rb, line 11
def initialize(doc)
  @uuid = doc.elements["id"].text
end

Public Instance Methods

get_value(doc, xpath, varname) click to toggle source
# File lib/ibm_power_hmc/objects.rb, line 15
def get_value(doc, xpath, varname)
  value = doc.elements[xpath]
  value = value.text unless value.nil?
  value = value.strip unless value.nil?
  self.class.__send__(:attr_reader, "#{varname}")
  instance_variable_set("@#{varname}", value)
end
get_values(doc, hash) click to toggle source
# File lib/ibm_power_hmc/objects.rb, line 23
def get_values(doc, hash)
  hash.each do |key, value|
    get_value(doc, key, value)
  end
end
to_s() click to toggle source
# File lib/ibm_power_hmc/objects.rb, line 29
def to_s
  "uuid=#{@uuid}"
end