Class: NOMS::Command::Auth::Identity

Inherits:
Base
  • Object
show all
Includes:
Enumerable
Defined in:
lib/noms/command/auth/identity.rb

Instance Method Summary collapse

Methods inherited from Base

#default_logger

Constructor Details

#initialize(auth, h, attrs = {}) ⇒ Identity

Returns a new instance of Identity.



20
21
22
23
24
# File 'lib/noms/command/auth/identity.rb', line 20

def initialize(auth, h, attrs={})
    @log = attrs[:logger] || default_logger
    @auth = auth
    @data = h
end

Instance Method Details

#[](key) ⇒ Object



26
27
28
# File 'lib/noms/command/auth/identity.rb', line 26

def [](key)
    @data[key]
end

#[]=(key, value) ⇒ Object



30
31
32
# File 'lib/noms/command/auth/identity.rb', line 30

def []=(key, value)
    @data[key] = value
end

#domainObject



54
55
56
# File 'lib/noms/command/auth/identity.rb', line 54

def domain
    @data['domain']
end

#eachObject



34
35
36
# File 'lib/noms/command/auth/identity.rb', line 34

def each
    @data.each
end

#idObject



46
47
48
# File 'lib/noms/command/auth/identity.rb', line 46

def id
    @data['id']
end

#keysObject



38
39
40
# File 'lib/noms/command/auth/identity.rb', line 38

def keys
    @data.keys
end

#realmObject



50
51
52
# File 'lib/noms/command/auth/identity.rb', line 50

def realm
    @data['realm']
end

#saveObject



42
43
44
# File 'lib/noms/command/auth/identity.rb', line 42

def save
    @log.debug "Saving #{@data['id']}"
end

#to_sObject



58
59
60
# File 'lib/noms/command/auth/identity.rb', line 58

def to_s
    "#{@data['id']}"
end