Class: Statefully::Diff::Change
- Inherits:
-
Object
- Object
- Statefully::Diff::Change
- Defined in:
- lib/statefully/diff.rb
Overview
class None
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#previous ⇒ Object
readonly
Returns the value of attribute previous.
Instance Method Summary collapse
-
#initialize(current, previous) ⇒ Change
constructor
A new instance of Change.
- #inspect ⇒ Object
- #none? ⇒ Boolean
Constructor Details
#initialize(current, previous) ⇒ Change
Returns a new instance of Change.
71 72 73 74 |
# File 'lib/statefully/diff.rb', line 71 def initialize(current, previous) @current = current @previous = previous end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
69 70 71 |
# File 'lib/statefully/diff.rb', line 69 def current @current end |
#previous ⇒ Object (readonly)
Returns the value of attribute previous.
69 70 71 |
# File 'lib/statefully/diff.rb', line 69 def previous @previous end |
Instance Method Details
#inspect ⇒ Object
80 81 82 83 |
# File 'lib/statefully/diff.rb', line 80 def inspect "#<#{self.class.name} " \ "#{Inspect.from_fields(current: current, previous: previous)}>" end |
#none? ⇒ Boolean
76 77 78 |
# File 'lib/statefully/diff.rb', line 76 def none? @current == @previous end |