Class: Conjur::BaseObject
Instance Attribute Summary collapse
Instance Method Summary
collapse
#build_object
Methods included from LogSource
#log
Constructor Details
#initialize(id, credentials) ⇒ BaseObject
Returns a new instance of BaseObject.
32
33
34
35
|
# File 'lib/conjur/base_object.rb', line 32
def initialize id, credentials
@id = cast_to_id(id)
@credentials = credentials
end
|
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
30
31
32
|
# File 'lib/conjur/base_object.rb', line 30
def credentials
@credentials
end
|
#id ⇒ Object
Returns the value of attribute id.
30
31
32
|
# File 'lib/conjur/base_object.rb', line 30
def id
@id
end
|
Instance Method Details
#account ⇒ Object
43
|
# File 'lib/conjur/base_object.rb', line 43
def account; id.account; end
|
#as_json(options = {}) ⇒ Object
37
38
39
40
41
|
# File 'lib/conjur/base_object.rb', line 37
def as_json options={}
{
id: id.to_s
}
end
|
#identifier ⇒ Object
45
|
# File 'lib/conjur/base_object.rb', line 45
def identifier; id.identifier; end
|
#kind ⇒ Object
44
|
# File 'lib/conjur/base_object.rb', line 44
def kind; id.kind; end
|
#username ⇒ Object
47
48
49
|
# File 'lib/conjur/base_object.rb', line 47
def username
credentials[:username] or raise "No username found in credentials"
end
|