Method: VMware::DataObject#properties

Defined in:
lib/vmware/objects/data_object.rb

#properties(prop_list = []) ⇒ Object

Retrieve all of the properties from the object as a hash.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/vmware/objects/data_object.rb', line 17

def properties(prop_list = [])
  return @cached_properties if @cached_properties
  
  prop_hash = {}
  @values.instance_variables.each do |var|
    val = @values.instance_eval(var)
    prop_hash[var.gsub(/^@/, "")] = VMware::DataObject::soap_to_data_object(val)
  end
  
  @cached_properties = prop_hash
end