Class: Herb::DiffOperation
- Inherits:
-
Data
- Object
- Data
- Herb::DiffOperation
- Defined in:
- lib/herb/diff_operation.rb,
lib/herb/diff_operation.rb,
sig/herb/diff_operation.rbs,
sig/herb/diff_operation.rbs
Instance Attribute Summary collapse
-
#new_index ⇒ Object
readonly
Returns the value of attribute new_index.
-
#new_node ⇒ Object
readonly
Returns the value of attribute new_node.
-
#old_index ⇒ Object
readonly
Returns the value of attribute old_index.
-
#old_node ⇒ Object
readonly
Returns the value of attribute old_node.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#inspect ⇒ String
: () -> String.
- #members ⇒ [ :type, :path, :old_node, :new_node, :old_index, :new_index ]
-
#to_hash ⇒ Hash[Symbol, untyped]
(also: #to_h)
: () -> Hash[Symbol, untyped].
Instance Attribute Details
#new_index ⇒ Object (readonly)
Returns the value of attribute new_index
5 6 7 |
# File 'lib/herb/diff_operation.rb', line 5 def new_index @new_index end |
#new_node ⇒ Object (readonly)
Returns the value of attribute new_node
5 6 7 |
# File 'lib/herb/diff_operation.rb', line 5 def new_node @new_node end |
#old_index ⇒ Object (readonly)
Returns the value of attribute old_index
5 6 7 |
# File 'lib/herb/diff_operation.rb', line 5 def old_index @old_index end |
#old_node ⇒ Object (readonly)
Returns the value of attribute old_node
5 6 7 |
# File 'lib/herb/diff_operation.rb', line 5 def old_node @old_node end |
#path ⇒ Object (readonly)
Returns the value of attribute path
5 6 7 |
# File 'lib/herb/diff_operation.rb', line 5 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type
5 6 7 |
# File 'lib/herb/diff_operation.rb', line 5 def type @type end |
Class Method Details
.members ⇒ [ :type, :path, :old_node, :new_node, :old_index, :new_index ]
20 |
# File 'sig/herb/diff_operation.rbs', line 20
def self.members: () -> [ :type, :path, :old_node, :new_node, :old_index, :new_index ]
|
.new(type, path, old_node, new_node, old_index, new_index) ⇒ instance .new(type:, path:, old_node:, new_node:, old_index:, new_index:) ⇒ instance
17 18 |
# File 'sig/herb/diff_operation.rbs', line 17
def self.new: (Symbol type, Array[Integer] path, Herb::AST::Node? old_node, Herb::AST::Node? new_node, Integer old_index, Integer new_index) -> instance
| (type: Symbol, path: Array[Integer], old_node: Herb::AST::Node?, new_node: Herb::AST::Node?, old_index: Integer, new_index: Integer) -> instance
|
Instance Method Details
#inspect ⇒ String
: () -> String
30 31 32 |
# File 'lib/herb/diff_operation.rb', line 30 def inspect "#<#{self.class.name} type=#{type} path=[#{path.join(", ")}]>" end |
#members ⇒ [ :type, :path, :old_node, :new_node, :old_index, :new_index ]
22 |
# File 'sig/herb/diff_operation.rbs', line 22
def members: () -> [ :type, :path, :old_node, :new_node, :old_index, :new_index ]
|
#to_hash ⇒ Hash[Symbol, untyped] Also known as: to_h
: () -> Hash[Symbol, untyped]
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/herb/diff_operation.rb', line 16 def to_hash { type: type, path: path, old_node: old_node, new_node: new_node, old_index: old_index, new_index: new_index, } end |