Class: Keystone::V2_0::Resource::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/keystone/v2_0/resource/base.rb

Direct Known Subclasses

Endpoint, Role, Service, Tenant, User

Instance Method Summary collapse

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