Class: YARP::CallOperatorAndWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::CallOperatorAndWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘&&=` operator on a call.
foo.bar &&= value
^^^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location.
-
#target ⇒ Object
readonly
attr_reader target: Node.
-
#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(target, operator_loc, value, location) ⇒ CallOperatorAndWriteNode
constructor
def initialize: (target: Node, operator_loc: Location, value: Node, location: Location) -> void.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(target, operator_loc, value, location) ⇒ CallOperatorAndWriteNode
def initialize: (target: Node, operator_loc: Location, value: Node, location: Location) -> void
873 874 875 876 877 878 |
# File 'lib/yarp/node.rb', line 873 def initialize(target, operator_loc, value, location) @target = target @operator_loc = operator_loc @value = value @location = location end |
Instance Attribute Details
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
867 868 869 |
# File 'lib/yarp/node.rb', line 867 def operator_loc @operator_loc end |
#target ⇒ Object (readonly)
attr_reader target: Node
864 865 866 |
# File 'lib/yarp/node.rb', line 864 def target @target end |
#value ⇒ Object (readonly)
attr_reader value: Node
870 871 872 |
# File 'lib/yarp/node.rb', line 870 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
881 882 883 |
# File 'lib/yarp/node.rb', line 881 def accept(visitor) visitor.visit_call_operator_and_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
887 888 889 |
# File 'lib/yarp/node.rb', line 887 def child_nodes [target, value] end |
#deconstruct_keys(keys) ⇒ Object
895 896 897 |
# File 'lib/yarp/node.rb', line 895 def deconstruct_keys(keys) { target: target, operator_loc: operator_loc, value: value, location: location } end |
#operator ⇒ Object
def operator: () -> String
900 901 902 |
# File 'lib/yarp/node.rb', line 900 def operator operator_loc.slice end |