class Prism::CallTargetNode
Represents assigning to a method call.
foo.bar, = 1 ^^^^^^^ begin rescue => foo.bar ^^^^^^^ end for foo.bar in baz do end ^^^^^^^
Represents assigning to a method call.
foo.bar, = 1 ^^^^^^^ begin rescue => foo.bar ^^^^^^^ end for foo.bar in baz do end ^^^^^^^
Public Class Methods
(Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 5841 def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc) @source = source @node_id = node_id @location = location @flags = flags @receiver = receiver @call_operator_loc = call_operator_loc @name = name @message_loc = message_loc end
Initialize a new CallTargetNode node.
Initialize a new CallTargetNode node.
: (Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc) -> 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 4021
def ===: (untyped other) -> boolish
: (untyped other) -> boolish
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/node.rbs, line 3889
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped]
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/node.rbs, line 3902
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 6036 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 5990 def receiver @receiver end
The object that the method is being called on. This can be any non-void expression.
foo.bar = 1 ^^^
:call-seq: receiver -> Node
The object that the method is being called on. This can be any non-void expression.
foo.bar = 1 ^^^
: () -> Prism::node
Flags
Public Instance Methods
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 5965 def attribute_write? flags.anybits?(CallNodeFlags::ATTRIBUTE_WRITE) end
a call that is an attribute write, so the value being written should be returned
:category: Flags a call that is an attribute write, so the value being written should be returned
: () -> bool
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 5973 def ignore_visibility? flags.anybits?(CallNodeFlags::IGNORE_VISIBILITY) end
a call that ignores method visibility
:category: Flags a call that ignores method visibility
: () -> bool
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 5957 def variable_call? flags.anybits?(CallNodeFlags::VARIABLE_CALL) end
a call that could have been a local variable
:category: Flags a call that could have been a local variable
: () -> bool
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 6008 def call_operator_loc location = @call_operator_loc return location if location.is_a?(Location) @call_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
Represents the Location of the call operator.
foo.bar = 1 ^
:category: Locations :call-seq: call_operator_loc -> Location
Represents the Location of the call operator.
foo.bar = 1 ^
: () -> Location
() → Location
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 6054 def message_loc location = @message_loc return location if location.is_a?(Location) @message_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
Represents the Location of the message.
foo.bar = 1 ^^^
:category: Locations :call-seq: message_loc -> Location
Represents the Location of the message.
foo.bar = 1 ^^^
: () -> Location
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 5866 def accept(visitor) visitor.visit_call_target_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 5873 def child_nodes [receiver] 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 5890 def compact_child_nodes [receiver] end
(?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) → CallTargetNode
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 5900 def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, name: self.name, message_loc: self.message_loc) CallTargetNode.new(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc) end
Creates a copy of self with the given fields, using self as the template.
:call-seq: copy(**fields) -> CallTargetNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode
() → 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 5881 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? yield receiver 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 6019 def save_call_operator_loc(repository) repository.enter(node_id, :call_operator_loc) end
Save the call_operator_loc location using the given saved source so that it can be retrieved later.
:category: Repository Save the call_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 6065 def save_message_loc(repository) repository.enter(node_id, :message_loc) end
Save the message_loc location using the given saved source so that it can be retrieved later.
:category: Repository Save the message_loc location using the given saved source so that it can be retrieved later.
: (_Repository repository) -> Relocation::Entry
Slicing
Public Instance Methods
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 6077 def call_operator call_operator_loc.slice end
Slice the location of call_operator_loc from the source.
:call-seq: call_operator -> String
Slice the location of call_operator_loc from the source.
: () -> String
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 6087 def message message_loc.slice end
Slice the location of message_loc from the source.
:call-seq: message -> String
Slice the location of message_loc from the source.
: () -> String