Class: Yesterday::VersionedAttribute
- Inherits:
-
Struct
- Object
- Struct
- Yesterday::VersionedAttribute
- Defined in:
- lib/yesterday/versioned_attribute.rb
Instance Attribute Summary collapse
-
#diff ⇒ Object
Returns the value of attribute diff.
Instance Method Summary collapse
Instance Attribute Details
#diff ⇒ Object
Returns the value of attribute diff
2 3 4 |
# File 'lib/yesterday/versioned_attribute.rb', line 2 def diff @diff end |
Instance Method Details
#current ⇒ Object
4 5 6 |
# File 'lib/yesterday/versioned_attribute.rb', line 4 def current diff.last end |
#modified? ⇒ Boolean
12 13 14 |
# File 'lib/yesterday/versioned_attribute.rb', line 12 def modified? current != previous end |
#previous ⇒ Object
8 9 10 |
# File 'lib/yesterday/versioned_attribute.rb', line 8 def previous diff.first end |
#to_i ⇒ Object
20 21 22 |
# File 'lib/yesterday/versioned_attribute.rb', line 20 def to_i current.to_i end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/yesterday/versioned_attribute.rb', line 16 def to_s current.to_s end |