Class: YARP::LocalVariableOperatorAndWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::LocalVariableOperatorAndWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘&&=` operator for assignment to a local variable.
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_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, location) ⇒ LocalVariableOperatorAndWriteNode
constructor
def initialize: (name_loc: Location, operator_loc: Location, value: Node, constant_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, location) ⇒ LocalVariableOperatorAndWriteNode
def initialize: (name_loc: Location, operator_loc: Location, value: Node, constant_id: Symbol, location: Location) -> void
3781 3782 3783 3784 3785 3786 3787 |
# File 'lib/yarp/node.rb', line 3781 def initialize(name_loc, operator_loc, value, constant_id, location) @name_loc = name_loc @operator_loc = operator_loc @value = value @constant_id = constant_id @location = location end |
Instance Attribute Details
#constant_id ⇒ Object (readonly)
attr_reader constant_id: Symbol
3778 3779 3780 |
# File 'lib/yarp/node.rb', line 3778 def constant_id @constant_id end |
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location
3769 3770 3771 |
# File 'lib/yarp/node.rb', line 3769 def name_loc @name_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
3772 3773 3774 |
# File 'lib/yarp/node.rb', line 3772 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
3775 3776 3777 |
# File 'lib/yarp/node.rb', line 3775 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3790 3791 3792 |
# File 'lib/yarp/node.rb', line 3790 def accept(visitor) visitor.visit_local_variable_operator_and_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3796 3797 3798 |
# File 'lib/yarp/node.rb', line 3796 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
3804 3805 3806 |
# File 'lib/yarp/node.rb', line 3804 def deconstruct_keys(keys) { name_loc: name_loc, operator_loc: operator_loc, value: value, constant_id: constant_id, location: location } end |
#name ⇒ Object
def name: () -> String
3809 3810 3811 |
# File 'lib/yarp/node.rb', line 3809 def name name_loc.slice end |
#operator ⇒ Object
def operator: () -> String
3814 3815 3816 |
# File 'lib/yarp/node.rb', line 3814 def operator operator_loc.slice end |