Class: YARP::InstanceVariableOperatorAndWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::InstanceVariableOperatorAndWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘&&=` operator for assignment to an instance variable.
@target &&= value
^^^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#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(name_loc, operator_loc, value, location) ⇒ InstanceVariableOperatorAndWriteNode
constructor
def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void.
-
#name ⇒ Object
def name: () -> String.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(name_loc, operator_loc, value, location) ⇒ InstanceVariableOperatorAndWriteNode
def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
3101 3102 3103 3104 3105 3106 |
# File 'lib/yarp/node.rb', line 3101 def initialize(name_loc, operator_loc, value, location) @name_loc = name_loc @operator_loc = operator_loc @value = value @location = location end |
Instance Attribute Details
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location
3092 3093 3094 |
# File 'lib/yarp/node.rb', line 3092 def name_loc @name_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
3095 3096 3097 |
# File 'lib/yarp/node.rb', line 3095 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
3098 3099 3100 |
# File 'lib/yarp/node.rb', line 3098 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3109 3110 3111 |
# File 'lib/yarp/node.rb', line 3109 def accept(visitor) visitor.visit_instance_variable_operator_and_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3115 3116 3117 |
# File 'lib/yarp/node.rb', line 3115 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
3123 3124 3125 |
# File 'lib/yarp/node.rb', line 3123 def deconstruct_keys(keys) { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location } end |
#name ⇒ Object
def name: () -> String
3128 3129 3130 |
# File 'lib/yarp/node.rb', line 3128 def name name_loc.slice end |
#operator ⇒ Object
def operator: () -> String
3133 3134 3135 |
# File 'lib/yarp/node.rb', line 3133 def operator operator_loc.slice end |