class Keystone::V2_0::Resource::Base

Public Class Methods

new(data) click to toggle source
# 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