Module: Opera::MobileStoreSDK::IdentityMapable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Opera::MobileStore::Build, Opera::MobileStore::Category, Opera::MobileStore::Developer, Opera::MobileStore::DeviceModel, Opera::MobileStore::DevicePlatform, Opera::MobileStore::DevicePlatformFamily
- Defined in:
- lib/opera/mobile_store_sdk/identity_mapable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Object
Registers itself in the identity map:.
Instance Method Details
#initialize(params = {}) ⇒ Object
Registers itself in the identity map:
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/opera/mobile_store_sdk/identity_mapable.rb', line 8 def initialize(params={}) super # Upsert in the identity map: if self.class.identity_map.key? self.id params.each do |field_name, field_value| self.class.identity_map[self.id].public_send( "#{field_name}=", field_value ) end else self.class.identity_map[self.id] = self end end |