Class: YARP::LocalVariableReadNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::LocalVariableReadNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call.
foo
^^^
Instance Attribute Summary collapse
-
#constant_id ⇒ Object
readonly
attr_reader constant_id: Symbol.
-
#depth ⇒ Object
readonly
attr_reader depth: Integer.
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(constant_id, depth, location) ⇒ LocalVariableReadNode
constructor
def initialize: (constant_id: Symbol, depth: Integer, location: Location) -> void.
Constructor Details
#initialize(constant_id, depth, location) ⇒ LocalVariableReadNode
def initialize: (constant_id: Symbol, depth: Integer, location: Location) -> void
3949 3950 3951 3952 3953 |
# File 'lib/yarp/node.rb', line 3949 def initialize(constant_id, depth, location) @constant_id = constant_id @depth = depth @location = location end |
Instance Attribute Details
#constant_id ⇒ Object (readonly)
attr_reader constant_id: Symbol
3943 3944 3945 |
# File 'lib/yarp/node.rb', line 3943 def constant_id @constant_id end |
#depth ⇒ Object (readonly)
attr_reader depth: Integer
3946 3947 3948 |
# File 'lib/yarp/node.rb', line 3946 def depth @depth end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3956 3957 3958 |
# File 'lib/yarp/node.rb', line 3956 def accept(visitor) visitor.visit_local_variable_read_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3962 3963 3964 |
# File 'lib/yarp/node.rb', line 3962 def child_nodes [] end |