Class: YARP::LocalVariableTargetNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::LocalVariableTargetNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents writing to a local variable in a context that doesn’t have an explicit value.
foo, bar = baz
^^^ ^^^
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
attr_reader depth: Integer.
-
#name ⇒ Object
readonly
attr_reader name: Symbol.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#copy(**params) ⇒ Object
def copy: (**params) -> LocalVariableTargetNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(name, depth, location) ⇒ LocalVariableTargetNode
constructor
def initialize: (name: Symbol, depth: Integer, location: Location) -> void.
Constructor Details
#initialize(name, depth, location) ⇒ LocalVariableTargetNode
def initialize: (name: Symbol, depth: Integer, location: Location) -> void
5054 5055 5056 5057 5058 |
# File 'lib/yarp/node.rb', line 5054 def initialize(name, depth, location) @name = name @depth = depth @location = location end |
Instance Attribute Details
#depth ⇒ Object (readonly)
attr_reader depth: Integer
5051 5052 5053 |
# File 'lib/yarp/node.rb', line 5051 def depth @depth end |
#name ⇒ Object (readonly)
attr_reader name: Symbol
5048 5049 5050 |
# File 'lib/yarp/node.rb', line 5048 def name @name end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
5061 5062 5063 |
# File 'lib/yarp/node.rb', line 5061 def accept(visitor) visitor.visit_local_variable_target_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
5066 5067 5068 |
# File 'lib/yarp/node.rb', line 5066 def child_nodes [] end |
#copy(**params) ⇒ Object
def copy: (**params) -> LocalVariableTargetNode
5071 5072 5073 5074 5075 5076 5077 |
# File 'lib/yarp/node.rb', line 5071 def copy(**params) LocalVariableTargetNode.new( params.fetch(:name) { name }, params.fetch(:depth) { depth }, params.fetch(:location) { location }, ) end |