Class: Odin::Types::DiffMove
- Inherits:
-
Object
- Object
- Odin::Types::DiffMove
- Defined in:
- lib/odin/types/diff.rb
Instance Attribute Summary collapse
-
#from_path ⇒ Object
readonly
Returns the value of attribute from_path.
-
#modifiers ⇒ Object
readonly
Returns the value of attribute modifiers.
-
#to_path ⇒ Object
readonly
Returns the value of attribute to_path.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(from_path:, to_path:, value:, modifiers: nil) ⇒ DiffMove
constructor
A new instance of DiffMove.
Constructor Details
#initialize(from_path:, to_path:, value:, modifiers: nil) ⇒ DiffMove
Returns a new instance of DiffMove.
53 54 55 56 57 58 59 |
# File 'lib/odin/types/diff.rb', line 53 def initialize(from_path:, to_path:, value:, modifiers: nil) @from_path = from_path.freeze @to_path = to_path.freeze @value = value @modifiers = modifiers freeze end |
Instance Attribute Details
#from_path ⇒ Object (readonly)
Returns the value of attribute from_path.
51 52 53 |
# File 'lib/odin/types/diff.rb', line 51 def from_path @from_path end |
#modifiers ⇒ Object (readonly)
Returns the value of attribute modifiers.
51 52 53 |
# File 'lib/odin/types/diff.rb', line 51 def modifiers @modifiers end |
#to_path ⇒ Object (readonly)
Returns the value of attribute to_path.
51 52 53 |
# File 'lib/odin/types/diff.rb', line 51 def to_path @to_path end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
51 52 53 |
# File 'lib/odin/types/diff.rb', line 51 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
61 62 63 64 65 |
# File 'lib/odin/types/diff.rb', line 61 def ==(other) other.is_a?(DiffMove) && from_path == other.from_path && to_path == other.to_path && value == other.value && modifiers == other.modifiers end |
#hash ⇒ Object
68 69 70 |
# File 'lib/odin/types/diff.rb', line 68 def hash [from_path, to_path, value, modifiers].hash end |