class Prism::ConstantPathOperatorWriteNode
Represents assigning to a constant path using an operator that isn’t=.
Parent::Child += value^^^^^^^^^^^^^^^^^^^^^^
Attributes
attr_readerbinary_operator:Symbol
attr_reader target:ConstantPathNode
attr_reader value: Prism::node
Public Class Methods
Source
# File lib/prism/node.rb, line 5243definitialize(source,node_id,location,flags,target,binary_operator_loc,value,binary_operator)@source =source@node_id =node_id@location =location@flags =flags@target =target@binary_operator_loc =binary_operator_loc@value =value@binary_operator =binary_operatorend
Initialize a newConstantPathOperatorWriteNode node.
Source
# File lib/prism/node.rb, line 5320defself.type:constant_path_operator_write_nodeend
Return a symbol representation of this node type. SeeNode::type.
Public Instance Methods
Source
# File lib/prism/node.rb, line 5326def===(other)other.is_a?(ConstantPathOperatorWriteNode)&& (target===other.target)&& (binary_operator_loc.nil?==other.binary_operator_loc.nil?)&& (value===other.value)&& (binary_operator===other.binary_operator)end
Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.
Source
# File lib/prism/node.rb, line 5255defaccept(visitor)visitor.visit_constant_path_operator_write_node(self)end
def accept: (Visitor visitor) -> void
Source
# File lib/prism/node.rb, line 5291defbinary_operator_loclocation =@binary_operator_locreturnlocationiflocation.is_a?(Location)@binary_operator_loc =Location.new(source,location>>32,location&0xFFFFFFFF)end
attr_readerbinary_operator_loc:Location
Source
# File lib/prism/node.rb, line 5260defchild_nodes [target,value]end
defchild_nodes: () ->Array
Source
# File lib/prism/node.rb, line 5270defcomment_targets [target,binary_operator_loc,value]#: Array[Prism::node | Location]end
defcomment_targets: () -> Array[Node | Location]
Source
# File lib/prism/node.rb, line 5265defcompact_child_nodes [target,value]end
defcompact_child_nodes: () ->Array
Source
# File lib/prism/node.rb, line 5275defcopy(node_id:self.node_id,location:self.location,flags:self.flags,target:self.target,binary_operator_loc:self.binary_operator_loc,value:self.value,binary_operator:self.binary_operator)ConstantPathOperatorWriteNode.new(source,node_id,location,flags,target,binary_operator_loc,value,binary_operator)end
def copy: (?node_id:Integer, ?location:Location, ?flags:Integer, ?target:ConstantPathNode, ?binary_operator_loc:Location, ?value: Prism::node, ?binary_operator:Symbol) ->ConstantPathOperatorWriteNode
Source
# File lib/prism/node.rb, line 5283defdeconstruct_keys(keys) {node_id:node_id,location:location,target:target,binary_operator_loc:binary_operator_loc,value:value,binary_operator:binary_operator }end
defdeconstruct_keys: (Array keys) -> { node_id:Integer, location:Location, target:ConstantPathNode,binary_operator_loc:Location, value: Prism::node,binary_operator:Symbol }
Source
# File lib/prism/node.rb, line 5310definspectInspectVisitor.compose(self)end
def inspect ->String
Source
# File lib/prism/node_ext.rb, line 390defoperatordeprecated("binary_operator")binary_operatorend
Returns the binary operator used to modify the receiver. This method is deprecated in favor ofbinary_operator.
Source
# File lib/prism/node_ext.rb, line 397defoperator_locdeprecated("binary_operator_loc")binary_operator_locend
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor ofbinary_operator_loc.
Source
# File lib/prism/node.rb, line 5299defsave_binary_operator_loc(repository)repository.enter(node_id,:binary_operator_loc)end
Save thebinary_operator_loc location using the given saved source so that it can be retrieved later.