Class: Odin::Types::DiffChange
- Inherits:
-
Object
- Object
- Odin::Types::DiffChange
- Defined in:
- lib/odin/types/diff.rb
Instance Attribute Summary collapse
-
#new_modifiers ⇒ Object
readonly
Returns the value of attribute new_modifiers.
-
#new_value ⇒ Object
readonly
Returns the value of attribute new_value.
-
#old_modifiers ⇒ Object
readonly
Returns the value of attribute old_modifiers.
-
#old_value ⇒ Object
readonly
Returns the value of attribute old_value.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(path:, old_value:, new_value:, old_modifiers: nil, new_modifiers: nil) ⇒ DiffChange
constructor
A new instance of DiffChange.
Constructor Details
#initialize(path:, old_value:, new_value:, old_modifiers: nil, new_modifiers: nil) ⇒ DiffChange
Returns a new instance of DiffChange.
29 30 31 32 33 34 35 36 |
# File 'lib/odin/types/diff.rb', line 29 def initialize(path:, old_value:, new_value:, old_modifiers: nil, new_modifiers: nil) @path = path.freeze @old_value = old_value @new_value = new_value @old_modifiers = old_modifiers @new_modifiers = new_modifiers freeze end |
Instance Attribute Details
#new_modifiers ⇒ Object (readonly)
Returns the value of attribute new_modifiers.
27 28 29 |
# File 'lib/odin/types/diff.rb', line 27 def new_modifiers @new_modifiers end |
#new_value ⇒ Object (readonly)
Returns the value of attribute new_value.
27 28 29 |
# File 'lib/odin/types/diff.rb', line 27 def new_value @new_value end |
#old_modifiers ⇒ Object (readonly)
Returns the value of attribute old_modifiers.
27 28 29 |
# File 'lib/odin/types/diff.rb', line 27 def old_modifiers @old_modifiers end |
#old_value ⇒ Object (readonly)
Returns the value of attribute old_value.
27 28 29 |
# File 'lib/odin/types/diff.rb', line 27 def old_value @old_value end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
27 28 29 |
# File 'lib/odin/types/diff.rb', line 27 def path @path end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
38 39 40 41 42 |
# File 'lib/odin/types/diff.rb', line 38 def ==(other) other.is_a?(DiffChange) && path == other.path && old_value == other.old_value && new_value == other.new_value && old_modifiers == other.old_modifiers && new_modifiers == other.new_modifiers end |
#hash ⇒ Object
45 46 47 |
# File 'lib/odin/types/diff.rb', line 45 def hash [path, old_value, new_value, old_modifiers, new_modifiers].hash end |