class Me::Identity

Represents certain person, or person in certain role or situation

Attributes

mapper[R]
name[R]

Public Class Methods

active() click to toggle source
# File lib/me/identity.rb, line 43
def active
  Registry.identity_mapper_factory.new.find
end
build(mapper:, name:, active_identity:) click to toggle source
# File lib/me/identity.rb, line 47
def build(mapper:, name:, active_identity:)
  Identity.new(name).with_mapper(mapper)
end
new(name) click to toggle source
# File lib/me/identity.rb, line 7
def initialize(name)
  @name = name
end

Public Instance Methods

==(other) click to toggle source
# File lib/me/identity.rb, line 11
def ==(other)
  return false unless other.is_a?(Identity)
  self.name == other.name
end
activate() click to toggle source
# File lib/me/identity.rb, line 20
def activate
  mapper.update(active_identity: name)
end
build_view(view_factory) click to toggle source
# File lib/me/identity.rb, line 16
def build_view(view_factory)
  view_factory.new(name: name)
end
git_config() click to toggle source
# File lib/me/identity.rb, line 24
def git_config
  GitConfig.for_identity(name)
end
ssh_config() click to toggle source
# File lib/me/identity.rb, line 28
def ssh_config
  SshConfig.for_identity(name)
end
with_mapper(mapper) click to toggle source
# File lib/me/identity.rb, line 32
def with_mapper(mapper)
  @mapper = mapper
  self
end