class Prism::LocalVariableOperatorWriteNode
Represents assigning to a local variable using an operator that isnโt =.
target += value ^^^^^^^^^^^^^^^
Represents assigning to a local variable using an operator that isnโt =.
target += value ^^^^^^^^^^^^^^^
Public Class Methods
(Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21615 def initialize(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth) @source = source @node_id = node_id @location = location @flags = flags @name_loc = name_loc @binary_operator_loc = binary_operator_loc @value = value @name = name @binary_operator = binary_operator @depth = depth end
Initialize a new LocalVariableOperatorWriteNode node.
Initialize a new LocalVariableOperatorWriteNode node.
: (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth) -> void
Public Instance Methods
(untyped other) → boolish
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/node.rbs, line 13946
def ===: (untyped other) -> boolish
: (untyped other) -> boolish
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21791 def binary_operator @binary_operator end
Returns the binary_operator attribute.
:call-seq: binary_operator -> Symbol
Returns the binary_operator attribute.
: () -> Symbol
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/node.rbs, line 13866
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped]
() → Integer
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21801 def depth @depth end
() → node
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/desugar_compiler.rbs, line 164
def desugar: () -> node
: () -> node
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/node.rbs, line 13879
def inspect: () -> String
: () -> String
() → Symbol
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21781 def name @name end
() → Prism::node
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21771 def value @value end
Returns the value attribute.
:call-seq: value -> Node
Returns the value attribute.
: () -> Prism::node
Locations
Public Instance Methods
() → Location
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21750 def binary_operator_loc location = @binary_operator_loc return location if location.is_a?(Location) @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
Returns the Location represented by binary_operator_loc.
:category: Locations :call-seq: binary_operator_loc -> Location
Returns the Location represented by binary_operator_loc.
: () -> Location
() → Location
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21728 def name_loc location = @name_loc return location if location.is_a?(Location) @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
Node Interface
These methods are present on all subclasses of Node. Read the node interface docs for more information.
Public Class Methods
Public Instance Methods
(_Visitor visitor) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21642 def accept(visitor) visitor.visit_local_variable_operator_write_node(self) end
() → Array[node?]
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21649 def child_nodes [value] end
() → Array[node]
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21666 def compact_child_nodes [value] end
(?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) → LocalVariableOperatorWriteNode
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21676 def copy(node_id: self.node_id, location: self.location, flags: self.flags, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, name: self.name, binary_operator: self.binary_operator, depth: self.depth) LocalVariableOperatorWriteNode.new(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth) end
Creates a copy of self with the given fields, using self as the template.
:call-seq: copy(**fields) -> LocalVariableOperatorWriteNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode
() → Enumerator[node, void]
() { (node) → void } → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21657 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? yield value end
See Node.each_child_node.
See Node.each_child_node.
: () -> Enumerator[node, void] : () { (node) -> void } -> void
Repository
Methods related to Relocation.
Public Instance Methods
(_Repository repository) → Relocation::Entry
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21761 def save_binary_operator_loc(repository) repository.enter(node_id, :binary_operator_loc) end
Save the binary_operator_loc location using the given saved source so that it can be retrieved later.
:category: Repository Save the binary_operator_loc location using the given saved source so that it can be retrieved later.
: (_Repository repository) -> Relocation::Entry
(_Repository repository) → Relocation::Entry
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 21739 def save_name_loc(repository) repository.enter(node_id, :name_loc) end
Save the name_loc location using the given saved source so that it can be retrieved later.
:category: Repository Save the name_loc location using the given saved source so that it can be retrieved later.
: (_Repository repository) -> Relocation::Entry