Class: YARP::ConstantPathWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ConstantPathWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents writing to a constant path.
::Foo = 1
^^^^^^^^^
Foo::Bar = 1
^^^^^^^^^^^^
::Foo::Bar = 1
^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#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, location) ⇒ ConstantPathWriteNode
constructor
def initialize: (target: Node, operator_loc: Location?, value: Node?, location: Location) -> void.
-
#operator ⇒ Object
def operator: () -> String?.
Constructor Details
#initialize(target, operator_loc, value, location) ⇒ ConstantPathWriteNode
def initialize: (target: Node, operator_loc: Location?, value: Node?, location: Location) -> void
1785 1786 1787 1788 1789 1790 |
# File 'lib/yarp/node.rb', line 1785 def initialize(target, operator_loc, value, location) @target = target @operator_loc = operator_loc @value = value @location = location end |
Instance Attribute Details
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location?
1779 1780 1781 |
# File 'lib/yarp/node.rb', line 1779 def operator_loc @operator_loc end |
#target ⇒ Object (readonly)
attr_reader target: Node
1776 1777 1778 |
# File 'lib/yarp/node.rb', line 1776 def target @target end |
#value ⇒ Object (readonly)
attr_reader value: Node?
1782 1783 1784 |
# File 'lib/yarp/node.rb', line 1782 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
1793 1794 1795 |
# File 'lib/yarp/node.rb', line 1793 def accept(visitor) visitor.visit_constant_path_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
1799 1800 1801 |
# File 'lib/yarp/node.rb', line 1799 def child_nodes [target, value] end |
#deconstruct_keys(keys) ⇒ Object
1807 1808 1809 |
# File 'lib/yarp/node.rb', line 1807 def deconstruct_keys(keys) { target: target, operator_loc: operator_loc, value: value, location: location } end |
#operator ⇒ Object
def operator: () -> String?
1812 1813 1814 |
# File 'lib/yarp/node.rb', line 1812 def operator operator_loc&.slice end |