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
1437 1438 1439 1440 1441 1442 |
# File 'lib/yarp/node.rb', line 1437 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
1428 1429 1430 |
# File 'lib/yarp/node.rb', line 1428 def name_loc @name_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
1431 1432 1433 |
# File 'lib/yarp/node.rb', line 1431 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
1434 1435 1436 |
# File 'lib/yarp/node.rb', line 1434 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
1445 1446 1447 |
# File 'lib/yarp/node.rb', line 1445 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]
1451 1452 1453 |
# File 'lib/yarp/node.rb', line 1451 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
1459 1460 1461 |
# File 'lib/yarp/node.rb', line 1459 def deconstruct_keys(keys) { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location } end |
#name ⇒ Object
def name: () -> String
1464 1465 1466 |
# File 'lib/yarp/node.rb', line 1464 def name name_loc.slice end |
#operator ⇒ Object
def operator: () -> String
1469 1470 1471 |
# File 'lib/yarp/node.rb', line 1469 def operator operator_loc.slice end |