Class: TreeDelta::Operation
- Inherits:
-
Object
- Object
- TreeDelta::Operation
- Defined in:
- lib/tree_delta/operation.rb
Instance Attribute Summary collapse
-
#identity ⇒ Object
readonly
Returns the value of attribute identity.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type:, identity:, value: nil, parent: nil, position: nil) ⇒ Operation
constructor
A new instance of Operation.
Constructor Details
#initialize(type:, identity:, value: nil, parent: nil, position: nil) ⇒ Operation
Returns a new instance of Operation.
5 6 7 8 9 10 11 |
# File 'lib/tree_delta/operation.rb', line 5 def initialize(type:, identity:, value: nil, parent: nil, position: nil) @type = type @identity = identity @value = value if value @parent = parent if parent @position = position if position end |
Instance Attribute Details
#identity ⇒ Object (readonly)
Returns the value of attribute identity.
3 4 5 |
# File 'lib/tree_delta/operation.rb', line 3 def identity @identity end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
3 4 5 |
# File 'lib/tree_delta/operation.rb', line 3 def parent @parent end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
3 4 5 |
# File 'lib/tree_delta/operation.rb', line 3 def position @position end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/tree_delta/operation.rb', line 3 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/tree_delta/operation.rb', line 3 def value @value end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/tree_delta/operation.rb', line 13 def ==(other) @type == other.type && @identity == other.identity && @value == other.value && @parent == other.parent && @position == other.position end |