Class: YARP::CallOperatorWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::CallOperatorWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of an assignment operator on a call.
foo. += baz
^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#operator ⇒ Object
readonly
attr_reader operator: Symbol.
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location.
-
#target ⇒ Object
readonly
attr_reader target: CallNode.
-
#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].
-
#copy(**params) ⇒ Object
def copy: (**params) -> CallOperatorWriteNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(target, operator_loc, value, operator, location) ⇒ CallOperatorWriteNode
constructor
def initialize: (target: CallNode, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void.
Constructor Details
#initialize(target, operator_loc, value, operator, location) ⇒ CallOperatorWriteNode
def initialize: (target: CallNode, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
1149 1150 1151 1152 1153 1154 1155 |
# File 'lib/yarp/node.rb', line 1149 def initialize(target, operator_loc, value, operator, location) @target = target @operator_loc = operator_loc @value = value @operator = operator @location = location end |
Instance Attribute Details
#operator ⇒ Object (readonly)
attr_reader operator: Symbol
1146 1147 1148 |
# File 'lib/yarp/node.rb', line 1146 def operator @operator end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
1140 1141 1142 |
# File 'lib/yarp/node.rb', line 1140 def operator_loc @operator_loc end |
#target ⇒ Object (readonly)
attr_reader target: CallNode
1137 1138 1139 |
# File 'lib/yarp/node.rb', line 1137 def target @target end |
#value ⇒ Object (readonly)
attr_reader value: Node
1143 1144 1145 |
# File 'lib/yarp/node.rb', line 1143 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
1158 1159 1160 |
# File 'lib/yarp/node.rb', line 1158 def accept(visitor) visitor.visit_call_operator_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
1163 1164 1165 |
# File 'lib/yarp/node.rb', line 1163 def child_nodes [target, value] end |
#copy(**params) ⇒ Object
def copy: (**params) -> CallOperatorWriteNode
1168 1169 1170 1171 1172 1173 1174 1175 1176 |
# File 'lib/yarp/node.rb', line 1168 def copy(**params) CallOperatorWriteNode.new( params.fetch(:target) { target }, params.fetch(:operator_loc) { operator_loc }, params.fetch(:value) { value }, params.fetch(:operator) { operator }, params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
1182 1183 1184 |
# File 'lib/yarp/node.rb', line 1182 def deconstruct_keys(keys) { target: target, operator_loc: operator_loc, value: value, operator: operator, location: location } end |