Class: Keystone::V2_0::Resource::Base
- Inherits:
-
Object
- Object
- Keystone::V2_0::Resource::Base
- Defined in:
- lib/keystone/v2_0/resource/base.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 13 14 15 |
# File 'lib/keystone/v2_0/resource/base.rb', line 7 def initialize(data) # dynaically assign attributes based on the # mappings provided by the subclass data.each do |key, val| if self.class.attr_mappings.keys.include?(key) self.send("#{self.class.attr_mappings[key]}=", data[key]) end end end |