Class: YARP::ConstantOperatorAndWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ConstantOperatorAndWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘&&=` operator for assignment to a constant.
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) ⇒ ConstantOperatorAndWriteNode
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) ⇒ ConstantOperatorAndWriteNode
def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
1421 1422 1423 1424 1425 1426 |
# File 'lib/yarp/node.rb', line 1421 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
1412 1413 1414 |
# File 'lib/yarp/node.rb', line 1412 def name_loc @name_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
1415 1416 1417 |
# File 'lib/yarp/node.rb', line 1415 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
1418 1419 1420 |
# File 'lib/yarp/node.rb', line 1418 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
1429 1430 1431 |
# File 'lib/yarp/node.rb', line 1429 def accept(visitor) visitor.visit_constant_operator_and_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
1434 1435 1436 |
# File 'lib/yarp/node.rb', line 1434 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
1442 1443 1444 |
# File 'lib/yarp/node.rb', line 1442 def deconstruct_keys(keys) { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location } end |
#name ⇒ Object
def name: () -> String
1447 1448 1449 |
# File 'lib/yarp/node.rb', line 1447 def name name_loc.slice end |
#operator ⇒ Object
def operator: () -> String
1452 1453 1454 |
# File 'lib/yarp/node.rb', line 1452 def operator operator_loc.slice end |