Class: YARP::LocalVariableOperatorWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::LocalVariableOperatorWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents assigning to a local variable using an operator that isn’t ‘=`.
target += value
^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#constant_id ⇒ Object
readonly
attr_reader constant_id: Symbol.
-
#name_loc ⇒ Object
readonly
attr_reader name_loc: Location.
-
#operator_id ⇒ Object
readonly
attr_reader operator_id: Symbol.
-
#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(name_loc, operator_loc, value, constant_id, operator_id, location) ⇒ LocalVariableOperatorWriteNode
constructor
def initialize: (name_loc: Location, operator_loc: Location, value: Node, constant_id: Symbol, operator_id: Symbol, location: Location) -> void.
-
#name ⇒ Object
def name: () -> String.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(name_loc, operator_loc, value, constant_id, operator_id, location) ⇒ LocalVariableOperatorWriteNode
def initialize: (name_loc: Location, operator_loc: Location, value: Node, constant_id: Symbol, operator_id: Symbol, location: Location) -> void
3896 3897 3898 3899 3900 3901 3902 3903 |
# File 'lib/yarp/node.rb', line 3896 def initialize(name_loc, operator_loc, value, constant_id, operator_id, location) @name_loc = name_loc @operator_loc = operator_loc @value = value @constant_id = constant_id @operator_id = operator_id @location = location end |
Instance Attribute Details
#constant_id ⇒ Object (readonly)
attr_reader constant_id: Symbol
3890 3891 3892 |
# File 'lib/yarp/node.rb', line 3890 def constant_id @constant_id end |
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location
3881 3882 3883 |
# File 'lib/yarp/node.rb', line 3881 def name_loc @name_loc end |
#operator_id ⇒ Object (readonly)
attr_reader operator_id: Symbol
3893 3894 3895 |
# File 'lib/yarp/node.rb', line 3893 def operator_id @operator_id end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
3884 3885 3886 |
# File 'lib/yarp/node.rb', line 3884 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
3887 3888 3889 |
# File 'lib/yarp/node.rb', line 3887 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3906 3907 3908 |
# File 'lib/yarp/node.rb', line 3906 def accept(visitor) visitor.visit_local_variable_operator_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3912 3913 3914 |
# File 'lib/yarp/node.rb', line 3912 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
3920 3921 3922 |
# File 'lib/yarp/node.rb', line 3920 def deconstruct_keys(keys) { name_loc: name_loc, operator_loc: operator_loc, value: value, constant_id: constant_id, operator_id: operator_id, location: location } end |
#name ⇒ Object
def name: () -> String
3925 3926 3927 |
# File 'lib/yarp/node.rb', line 3925 def name name_loc.slice end |
#operator ⇒ Object
def operator: () -> String
3930 3931 3932 |
# File 'lib/yarp/node.rb', line 3930 def operator operator_loc.slice end |