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
3996 3997 3998 3999 4000 4001 4002 4003 |
# File 'lib/yarp/node.rb', line 3996 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
3981 3982 3983 |
# File 'lib/yarp/node.rb', line 3981 def constant_id @constant_id end |
#depth ⇒ Object (readonly)
attr_reader depth: Integer
3984 3985 3986 |
# File 'lib/yarp/node.rb', line 3984 def depth @depth end |
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location
3990 3991 3992 |
# File 'lib/yarp/node.rb', line 3990 def name_loc @name_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location?
3993 3994 3995 |
# File 'lib/yarp/node.rb', line 3993 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node?
3987 3988 3989 |
# File 'lib/yarp/node.rb', line 3987 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
4006 4007 4008 |
# File 'lib/yarp/node.rb', line 4006 def accept(visitor) visitor.visit_local_variable_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
4012 4013 4014 |
# File 'lib/yarp/node.rb', line 4012 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
4020 4021 4022 |
# File 'lib/yarp/node.rb', line 4020 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
4025 4026 4027 |
# File 'lib/yarp/node.rb', line 4025 def name name_loc.slice end |
#operator ⇒ Object
def operator: () -> String?
4030 4031 4032 |
# File 'lib/yarp/node.rb', line 4030 def operator operator_loc&.slice end |