Class: YARP::ConstantPathOperatorWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ConstantPathOperatorWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents assigning to a constant path using an operator that isn’t ‘=`.
Parent::Child += value
^^^^^^^^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#operator ⇒ Object
readonly
attr_reader operator: Symbol.
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location.
-
#target ⇒ Object
readonly
attr_reader target: Node.
-
#value ⇒ Object
readonly
attr_reader value: Node.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(target, operator_loc, value, operator, location) ⇒ ConstantPathOperatorWriteNode
constructor
def initialize: (target: Node, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void.
Constructor Details
#initialize(target, operator_loc, value, operator, location) ⇒ ConstantPathOperatorWriteNode
def initialize: (target: Node, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
1714 1715 1716 1717 1718 1719 1720 |
# File 'lib/yarp/node.rb', line 1714 def initialize(target, operator_loc, value, operator, location) @target = target @operator_loc = operator_loc @value = value @operator = operator @location = location end |
Instance Attribute Details
#operator ⇒ Object (readonly)
attr_reader operator: Symbol
1711 1712 1713 |
# File 'lib/yarp/node.rb', line 1711 def operator @operator end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
1705 1706 1707 |
# File 'lib/yarp/node.rb', line 1705 def operator_loc @operator_loc end |
#target ⇒ Object (readonly)
attr_reader target: Node
1702 1703 1704 |
# File 'lib/yarp/node.rb', line 1702 def target @target end |
#value ⇒ Object (readonly)
attr_reader value: Node
1708 1709 1710 |
# File 'lib/yarp/node.rb', line 1708 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
1723 1724 1725 |
# File 'lib/yarp/node.rb', line 1723 def accept(visitor) visitor.visit_constant_path_operator_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
1728 1729 1730 |
# File 'lib/yarp/node.rb', line 1728 def child_nodes [target, value] end |
#deconstruct_keys(keys) ⇒ Object
1736 1737 1738 |
# File 'lib/yarp/node.rb', line 1736 def deconstruct_keys(keys) { target: target, operator_loc: operator_loc, value: value, operator: operator, location: location } end |