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