Module: Conjur::HasAttributes
Instance Method Summary collapse
- #attributes ⇒ Object
- #attributes=(a) ⇒ Object
- #invalidate(&block) ⇒ Object
-
#refresh ⇒ Object
Reload the attributes.
- #save ⇒ Object
- #to_json(options = {}) ⇒ Object
Instance Method Details
#attributes ⇒ Object
28 29 30 31 |
# File 'lib/conjur/has_attributes.rb', line 28 def attributes return @attributes if @attributes fetch end |
#attributes=(a) ⇒ Object
27 |
# File 'lib/conjur/has_attributes.rb', line 27 def attributes=(a); @attributes = a; end |
#invalidate(&block) ⇒ Object
43 44 45 46 47 |
# File 'lib/conjur/has_attributes.rb', line 43 def invalidate(&block) yield ensure @attributes = nil end |
#refresh ⇒ Object
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.
39 40 41 |
# File 'lib/conjur/has_attributes.rb', line 39 def refresh fetch end |
#save ⇒ Object
33 34 35 |
# File 'lib/conjur/has_attributes.rb', line 33 def save self.put(attributes.to_json) end |
#to_json(options = {}) ⇒ Object
23 24 25 |
# File 'lib/conjur/has_attributes.rb', line 23 def to_json( = {}) attributes end |