Class: Printfection::Resource
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- Printfection::Resource
- Includes:
- Hashie::Extensions::Coercion, Hashie::Extensions::IndifferentAccess
- Defined in:
- lib/printfection/resource.rb
Instance Attribute Summary collapse
-
#relation ⇒ Object
Returns the value of attribute relation.
Instance Method Summary collapse
- #changes ⇒ Object
-
#initialize(*args) ⇒ Resource
constructor
A new instance of Resource.
- #uri ⇒ Object
Constructor Details
#initialize(*args) ⇒ Resource
Returns a new instance of Resource.
10 11 12 13 |
# File 'lib/printfection/resource.rb', line 10 def initialize(*args) super @_old = self.dup end |
Instance Attribute Details
#relation ⇒ Object
Returns the value of attribute relation.
8 9 10 |
# File 'lib/printfection/resource.rb', line 8 def relation @relation end |
Instance Method Details
#changes ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/printfection/resource.rb', line 20 def changes keys.inject({}) do |diff, key| unless self[key] == @_old[key] diff[key] = self[key] end diff end end |