Class: YARP::InstanceVariableOperatorWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::InstanceVariableOperatorWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents assigning to an instance variable using an operator that isn’t ‘=`.
@target += value
^^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#name_loc ⇒ Object
readonly
attr_reader name_loc: Location.
-
#operator ⇒ Object
readonly
attr_reader operator: 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, operator, location) ⇒ InstanceVariableOperatorWriteNode
constructor
def initialize: (name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void.
-
#name ⇒ Object
def name: () -> String.
Constructor Details
#initialize(name_loc, operator_loc, value, operator, location) ⇒ InstanceVariableOperatorWriteNode
def initialize: (name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
3213 3214 3215 3216 3217 3218 3219 |
# File 'lib/yarp/node.rb', line 3213 def initialize(name_loc, operator_loc, value, operator, location) @name_loc = name_loc @operator_loc = operator_loc @value = value @operator = operator @location = location end |
Instance Attribute Details
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location
3201 3202 3203 |
# File 'lib/yarp/node.rb', line 3201 def name_loc @name_loc end |
#operator ⇒ Object (readonly)
attr_reader operator: Symbol
3210 3211 3212 |
# File 'lib/yarp/node.rb', line 3210 def operator @operator end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
3204 3205 3206 |
# File 'lib/yarp/node.rb', line 3204 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
3207 3208 3209 |
# File 'lib/yarp/node.rb', line 3207 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3222 3223 3224 |
# File 'lib/yarp/node.rb', line 3222 def accept(visitor) visitor.visit_instance_variable_operator_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3227 3228 3229 |
# File 'lib/yarp/node.rb', line 3227 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
3235 3236 3237 |
# File 'lib/yarp/node.rb', line 3235 def deconstruct_keys(keys) { name_loc: name_loc, operator_loc: operator_loc, value: value, operator: operator, location: location } end |
#name ⇒ Object
def name: () -> String
3240 3241 3242 |
# File 'lib/yarp/node.rb', line 3240 def name name_loc.slice end |