class Me::Mappers::IdentityStore2

Attributes

name[R]

Public Class Methods

new(name = nil) click to toggle source
# File lib/me/mappers/identity_store2.rb, line 6
def initialize(name = nil)
  @name = name || active_identity
end

Public Instance Methods

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

Private Instance Methods

active_identity() click to toggle source
# File lib/me/mappers/identity_store2.rb, line 30
def active_identity
  store.get_or_set("active_identity", "<none>")
end
store() click to toggle source
# File lib/me/mappers/identity_store2.rb, line 34
def store
  @_store ||= Store.build
end