Class: Statefully::Diff::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/statefully/diff.rb

Overview

class Finished

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current, previous) ⇒ Change

Returns a new instance of Change.



96
97
98
99
# File 'lib/statefully/diff.rb', line 96

def initialize(current, previous)
  @current = current
  @previous = previous
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



94
95
96
# File 'lib/statefully/diff.rb', line 94

def current
  @current
end

#previousObject (readonly)

Returns the value of attribute previous.



94
95
96
# File 'lib/statefully/diff.rb', line 94

def previous
  @previous
end

Instance Method Details

#inspectObject



105
106
107
108
# File 'lib/statefully/diff.rb', line 105

def inspect
  "#<#{self.class.name} " \
  "#{Inspect.from_fields(current: current, previous: previous)}>"
end

#none?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/statefully/diff.rb', line 101

def none?
  @current == @previous
end