Module: Conjur::HasAttributes

Included in:
Host, Resource
Defined in:
lib/conjur/has_attributes.rb

Instance Method Summary collapse

Instance Method Details

#attributesObject



8
9
10
11
# File 'lib/conjur/has_attributes.rb', line 8

def attributes
  return @attributes if @attributes
  fetch
end

#attributes=(a) ⇒ Object



7
# File 'lib/conjur/has_attributes.rb', line 7

def attributes=(a); @attributes = a; end

#refreshObject

Reload the attributes. This action can be used to guarantee a current view of the entity in the case that it has been modified by an update method or by an external party.



19
20
21
# File 'lib/conjur/has_attributes.rb', line 19

def refresh
  fetch
end

#saveObject



13
14
15
# File 'lib/conjur/has_attributes.rb', line 13

def save
  self.put(attributes.to_json)
end

#to_json(options = {}) ⇒ Object



3
4
5
# File 'lib/conjur/has_attributes.rb', line 3

def to_json(options = {})
  attributes
end