class Prism::AssocSplatNode
Represents a splat in a hash literal.
{ **foo }
^^^^^
Represents a splat in a hash literal.
{ **foo }
^^^^^
Public Class Methods
(Source source, Integer node_id, Location location, Integer flags, Prism::node? value, Location operator_loc) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 2234 def initialize(source, node_id, location, flags, value, operator_loc) @source = source @node_id = node_id @location = location @flags = flags @value = value @operator_loc = operator_loc end
Initialize a new AssocSplatNode node.
Initialize a new AssocSplatNode node.
: (Source source, Integer node_id, Location location, Integer flags, Prism::node? value, Location operator_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 1563
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 1501
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 1514
def inspect: () -> String
: () -> String
() → Prism::node?
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 2348 def value @value end
The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used.
{ **foo }
^^^
:call-seq: value -> Node | nil
The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used.
{ **foo }
^^^
: () -> 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 2366 def operator_loc location = @operator_loc return location if location.is_a?(Location) @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
The Location of the ** operator.
{ **x }
^^
:category: Locations :call-seq: operator_loc -> Location
The Location of the ** operator.
{ **x }
^^
: () -> 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 2257 def accept(visitor) visitor.visit_assoc_splat_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 2264 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 2281 def compact_child_nodes compact = [] #: Array[Prism::node] if (value = self.value); compact << value; end compact end
(?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) → AssocSplatNode
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 2293 def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value, operator_loc: self.operator_loc) AssocSplatNode.new(source, node_id, location, flags, value, operator_loc) end
Creates a copy of self with the given fields, using self as the template.
:call-seq: copy(**fields) -> AssocSplatNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode
() → 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 2272 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? if (value = self.value); yield value; end 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 2377 def save_operator_loc(repository) repository.enter(node_id, :operator_loc) end
Save the operator_loc location using the given saved source so that it can be retrieved later.
:category: Repository Save the operator_loc location using the given saved source so that it can be retrieved later.
: (_Repository repository) -> Relocation::Entry
Slicing
Public Instance Methods
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 2389 def operator operator_loc.slice end
Slice the location of operator_loc from the source.
:call-seq: operator -> String
Slice the location of operator_loc from the source.
: () -> String