1. Prism::
  2. IndexOperatorWriteNode

class Prism::IndexOperatorWriteNode

Represents the use of an assignment operator on a call to[].

foo.bar[baz] += value^^^^^^^^^^^^^^^^^^^^^

Attributes

arguments[R]

attr_reader arguments:ArgumentsNode?

binary_operator[R]

attr_readerbinary_operator:Symbol

block[R]

attr_reader block:BlockArgumentNode?

receiver[R]

attr_reader receiver: Prism::node?

value[R]

attr_reader value: Prism::node

Public Class Methods

Source
# File lib/prism/node.rb, line 9348definitialize(source,node_id,location,flags,receiver,call_operator_loc,opening_loc,arguments,closing_loc,block,binary_operator,binary_operator_loc,value)@source =source@node_id =node_id@location =location@flags =flags@receiver =receiver@call_operator_loc =call_operator_loc@opening_loc =opening_loc@arguments =arguments@closing_loc =closing_loc@block =block@binary_operator =binary_operator@binary_operator_loc =binary_operator_loc@value =valueend

Initialize a newIndexOperatorWriteNode node.

Source
# File lib/prism/node.rb, line 9521defself.type:index_operator_write_nodeend

Return a symbol representation of this node type. SeeNode::type.

Public Instance Methods

Source
# File lib/prism/node.rb, line 9527def===(other)other.is_a?(IndexOperatorWriteNode)&&    (flags===other.flags)&&    (receiver===other.receiver)&&    (call_operator_loc.nil?==other.call_operator_loc.nil?)&&    (opening_loc.nil?==other.opening_loc.nil?)&&    (arguments===other.arguments)&&    (closing_loc.nil?==other.closing_loc.nil?)&&    (block===other.block)&&    (binary_operator===other.binary_operator)&&    (binary_operator_loc.nil?==other.binary_operator_loc.nil?)&&    (value===other.value)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 9365defaccept(visitor)visitor.visit_index_operator_write_node(self)end

def accept: (Visitor visitor) -> void

Source
# File lib/prism/node.rb, line 9413defattribute_write?flags.anybits?(CallNodeFlags::ATTRIBUTE_WRITE)end

def attribute_write?: () -> bool

Source
# File lib/prism/node.rb, line 9480defbinary_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 9496defcall_operatorcall_operator_loc&.sliceend

defcall_operator: () ->String?

Source
# File lib/prism/node.rb, line 9426defcall_operator_loclocation =@call_operator_loccaselocationwhennilnilwhenLocationlocationelse@call_operator_loc =Location.new(source,location>>32,location&0xFFFFFFFF)endend

attr_readercall_operator_loc:Location?

Source
# File lib/prism/node.rb, line 9370defchild_nodes  [receiver,arguments,block,value]end

defchild_nodes: () ->Array

Also aliased as:deconstruct
Source
# File lib/prism/node.rb, line 9506defclosingclosing_loc.sliceend

def closing: () ->String

Source
# File lib/prism/node.rb, line 9461defclosing_loclocation =@closing_locreturnlocationiflocation.is_a?(Location)@closing_loc =Location.new(source,location>>32,location&0xFFFFFFFF)end

attr_readerclosing_loc:Location

Source
# File lib/prism/node.rb, line 9385defcomment_targets  [*receiver,*call_operator_loc,opening_loc,*arguments,closing_loc,*block,binary_operator_loc,value]#: Array[Prism::node | Location]end

defcomment_targets: () -> Array[Node | Location]

Source
# File lib/prism/node.rb, line 9375defcompact_child_nodescompact = []#: Array[Prism::node]compact<<receiverifreceivercompact<<argumentsifargumentscompact<<blockifblockcompact<<valuecompactend

defcompact_child_nodes: () ->Array

Source
# File lib/prism/node.rb, line 9390defcopy(node_id:self.node_id,location:self.location,flags:self.flags,receiver:self.receiver,call_operator_loc:self.call_operator_loc,opening_loc:self.opening_loc,arguments:self.arguments,closing_loc:self.closing_loc,block:self.block,binary_operator:self.binary_operator,binary_operator_loc:self.binary_operator_loc,value:self.value)IndexOperatorWriteNode.new(source,node_id,location,flags,receiver,call_operator_loc,opening_loc,arguments,closing_loc,block,binary_operator,binary_operator_loc,value)end

def copy: (?node_id:Integer, ?location:Location, ?flags:Integer, ?receiver: Prism::node?, ?call_operator_loc:Location?, ?opening_loc:Location, ?arguments:ArgumentsNode?, ?closing_loc:Location, ?block:BlockArgumentNode?, ?binary_operator:Symbol, ?binary_operator_loc:Location, ?value: Prism::node) ->IndexOperatorWriteNode

def deconstruct: () ->Array

Alias for:child_nodes
Source
# File lib/prism/node.rb, line 9398defdeconstruct_keys(keys)  {node_id:node_id,location:location,receiver:receiver,call_operator_loc:call_operator_loc,opening_loc:opening_loc,arguments:arguments,closing_loc:closing_loc,block:block,binary_operator:binary_operator,binary_operator_loc:binary_operator_loc,value:value }end

defdeconstruct_keys: (Array keys) -> { node_id:Integer, location:Location, receiver: Prism::node?,call_operator_loc:Location?,opening_loc:Location, arguments:ArgumentsNode?,closing_loc:Location, block:BlockArgumentNode?,binary_operator:Symbol,binary_operator_loc:Location, value: Prism::node }

Source
# File lib/prism/node.rb, line 9418defignore_visibility?flags.anybits?(CallNodeFlags::IGNORE_VISIBILITY)end

def ignore_visibility?: () -> bool

Source
# File lib/prism/node.rb, line 9511definspectInspectVisitor.compose(self)end

def inspect ->String

Source
# File lib/prism/node.rb, line 9501defopeningopening_loc.sliceend

def opening: () ->String

Source
# File lib/prism/node.rb, line 9445defopening_loclocation =@opening_locreturnlocationiflocation.is_a?(Location)@opening_loc =Location.new(source,location>>32,location&0xFFFFFFFF)end

attr_readeropening_loc:Location

Source
# File lib/prism/node_ext.rb, line 422defoperatordeprecated("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 429defoperator_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 9403defsafe_navigation?flags.anybits?(CallNodeFlags::SAFE_NAVIGATION)end

def safe_navigation?: () -> bool

Source
# File lib/prism/node.rb, line 9488defsave_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.

Source
# File lib/prism/node.rb, line 9440defsave_call_operator_loc(repository)repository.enter(node_id,:call_operator_loc)unless@call_operator_loc.nil?end

Save thecall_operator_loc location using the given saved source so that it can be retrieved later.

Source
# File lib/prism/node.rb, line 9469defsave_closing_loc(repository)repository.enter(node_id,:closing_loc)end

Save theclosing_loc location using the given saved source so that it can be retrieved later.

Source
# File lib/prism/node.rb, line 9453defsave_opening_loc(repository)repository.enter(node_id,:opening_loc)end

Save theopening_loc location using the given saved source so that it can be retrieved later.

Source
# File lib/prism/node.rb, line 9516deftype:index_operator_write_nodeend

Return a symbol representation of this node type. SeeNode#type.

Source
# File lib/prism/node.rb, line 9408defvariable_call?flags.anybits?(CallNodeFlags::VARIABLE_CALL)end

def variable_call?: () -> bool