Class: Statefully::Diff::Change

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

Overview

class None

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#currentObject (readonly)

Returns the value of attribute current.



69
70
71
# File 'lib/statefully/diff.rb', line 69

def current
  @current
end

#previousObject (readonly)

Returns the value of attribute previous.



69
70
71
# File 'lib/statefully/diff.rb', line 69

def previous
  @previous
end

Instance Method Details

#inspectObject



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

Returns:

  • (Boolean)


76
77
78
# File 'lib/statefully/diff.rb', line 76

def none?
  @current == @previous
end