Class: Vcloud::Walker::Resource::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/vcloud/walker/resource/entity.rb

Instance Method Summary collapse

Instance Method Details

#to_summaryObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/vcloud/walker/resource/entity.rb', line 6

def to_summary
  h= {}
  instance_variables.each { |atr|
    atr_value = self.instance_variable_get(atr)
    if atr_value.is_a?(Vcloud::Walker::Resource::Collection) || atr_value.is_a?(Entity)
      h[atr.to_s.delete("@").to_sym] = atr_value.to_summary
    else
      h[atr.to_s.delete("@").to_sym] = atr_value
    end
  }
  h
end