Class: YARP::LocalVariableWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::LocalVariableWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents writing to a local variable.
foo = 1
^^^^^^^
Instance Attribute Summary collapse
-
#constant_id ⇒ Object
readonly
attr_reader constant_id: Symbol.
-
#depth ⇒ Object
readonly
attr_reader depth: Integer.
-
#name_loc ⇒ Object
readonly
attr_reader name_loc: Location.
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location?.
-
#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(constant_id, depth, value, name_loc, operator_loc, location) ⇒ LocalVariableWriteNode
constructor
def initialize: (constant_id: Symbol, depth: Integer, value: Node?, name_loc: Location, operator_loc: Location?, location: Location) -> void.
-
#name ⇒ Object
def name: () -> String.
-
#operator ⇒ Object
def operator: () -> String?.
Constructor Details
#initialize(constant_id, depth, value, name_loc, operator_loc, location) ⇒ LocalVariableWriteNode
def initialize: (constant_id: Symbol, depth: Integer, value: Node?, name_loc: Location, operator_loc: Location?, location: Location) -> void
4029 4030 4031 4032 4033 4034 4035 4036 |
# File 'lib/yarp/node.rb', line 4029 def initialize(constant_id, depth, value, name_loc, operator_loc, location) @constant_id = constant_id @depth = depth @value = value @name_loc = name_loc @operator_loc = operator_loc @location = location end |
Instance Attribute Details
#constant_id ⇒ Object (readonly)
attr_reader constant_id: Symbol
4014 4015 4016 |
# File 'lib/yarp/node.rb', line 4014 def constant_id @constant_id end |
#depth ⇒ Object (readonly)
attr_reader depth: Integer
4017 4018 4019 |
# File 'lib/yarp/node.rb', line 4017 def depth @depth end |
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location
4023 4024 4025 |
# File 'lib/yarp/node.rb', line 4023 def name_loc @name_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location?
4026 4027 4028 |
# File 'lib/yarp/node.rb', line 4026 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node?
4020 4021 4022 |
# File 'lib/yarp/node.rb', line 4020 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
4039 4040 4041 |
# File 'lib/yarp/node.rb', line 4039 def accept(visitor) visitor.visit_local_variable_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
4044 4045 4046 |
# File 'lib/yarp/node.rb', line 4044 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
4052 4053 4054 |
# File 'lib/yarp/node.rb', line 4052 def deconstruct_keys(keys) { constant_id: constant_id, depth: depth, value: value, name_loc: name_loc, operator_loc: operator_loc, location: location } end |
#name ⇒ Object
def name: () -> String
4057 4058 4059 |
# File 'lib/yarp/node.rb', line 4057 def name name_loc.slice end |
#operator ⇒ Object
def operator: () -> String?
4062 4063 4064 |
# File 'lib/yarp/node.rb', line 4062 def operator operator_loc&.slice end |