Class: Me::Mappers::IdentityStore2

Inherits:
Identity::Mapper show all
Defined in:
lib/me/mappers/identity_store2.rb

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ IdentityStore2

Returns a new instance of IdentityStore2.



6
7
8
# File 'lib/me/mappers/identity_store2.rb', line 6

def initialize(name = nil)
  @name = name || active_identity
end

Instance Method Details

#findObject



10
11
12
13
14
15
16
# File 'lib/me/mappers/identity_store2.rb', line 10

def find
  Identity.build(
    mapper: self,
    name: name,
    active_identity: active_identity,
  )
end

#update(name: nil, active_identity: nil) ⇒ Object



18
19
20
21
22
# File 'lib/me/mappers/identity_store2.rb', line 18

def update(name: nil, active_identity: nil)
  return unless active_identity
  store.set("active_identity", active_identity)
  store.save
end