Class: Odin::Types::DiffEntry
- Inherits:
-
Object
- Object
- Odin::Types::DiffEntry
- Defined in:
- lib/odin/types/diff.rb
Instance Attribute Summary collapse
-
#modifiers ⇒ Object
readonly
Returns the value of attribute modifiers.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(path:, value:, modifiers: nil) ⇒ DiffEntry
constructor
A new instance of DiffEntry.
Constructor Details
#initialize(path:, value:, modifiers: nil) ⇒ DiffEntry
Returns a new instance of DiffEntry.
8 9 10 11 12 13 |
# File 'lib/odin/types/diff.rb', line 8 def initialize(path:, value:, modifiers: nil) @path = path.freeze @value = value @modifiers = modifiers freeze end |
Instance Attribute Details
#modifiers ⇒ Object (readonly)
Returns the value of attribute modifiers.
6 7 8 |
# File 'lib/odin/types/diff.rb', line 6 def modifiers @modifiers end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/odin/types/diff.rb', line 6 def path @path end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/odin/types/diff.rb', line 6 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
15 16 17 18 |
# File 'lib/odin/types/diff.rb', line 15 def ==(other) other.is_a?(DiffEntry) && path == other.path && value == other.value && modifiers == other.modifiers end |
#hash ⇒ Object
21 22 23 |
# File 'lib/odin/types/diff.rb', line 21 def hash [path, value, modifiers].hash end |