Class: YARP::GlobalVariableOperatorWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::GlobalVariableOperatorWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents assigning to a global 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) ⇒ GlobalVariableOperatorWriteNode
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) ⇒ GlobalVariableOperatorWriteNode
def initialize: (name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
2700 2701 2702 2703 2704 2705 2706 |
# File 'lib/yarp/node.rb', line 2700 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
2688 2689 2690 |
# File 'lib/yarp/node.rb', line 2688 def name_loc @name_loc end |
#operator ⇒ Object (readonly)
attr_reader operator: Symbol
2697 2698 2699 |
# File 'lib/yarp/node.rb', line 2697 def operator @operator end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
2691 2692 2693 |
# File 'lib/yarp/node.rb', line 2691 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
2694 2695 2696 |
# File 'lib/yarp/node.rb', line 2694 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
2709 2710 2711 |
# File 'lib/yarp/node.rb', line 2709 def accept(visitor) visitor.visit_global_variable_operator_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
2715 2716 2717 |
# File 'lib/yarp/node.rb', line 2715 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
2723 2724 2725 |
# File 'lib/yarp/node.rb', line 2723 def deconstruct_keys(keys) { name_loc: name_loc, operator_loc: operator_loc, value: value, operator: operator, location: location } end |
#name ⇒ Object
def name: () -> String
2728 2729 2730 |
# File 'lib/yarp/node.rb', line 2728 def name name_loc.slice end |