class Prism::ForwardingSuperNode
Represents the use of the super keyword without parentheses or arguments, but which might have a block.
super ^^^^^ super { 123 } ^^^^^^^^^^^^^
Explore code sample If it has any other arguments, it would be a SuperNode instead.
Represents the use of the super keyword without parentheses or arguments, but which might have a block.
super ^^^^^ super { 123 } ^^^^^^^^^^^^^
Explore code sample If it has any other arguments, it would be a SuperNode instead.
Public Class Methods
(Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, BlockNode? block) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 13770 def initialize(source, node_id, location, flags, keyword_loc, block) @source = source @node_id = node_id @location = location @flags = flags @keyword_loc = keyword_loc @block = block end
Initialize a new ForwardingSuperNode node.
Initialize a new ForwardingSuperNode node.
: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, BlockNode? block) -> 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 8973
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 13903 def block @block end
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 13882 def keyword_loc location = @keyword_loc return location if location.is_a?(Location) @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
super ^^^^^
super { 123 } ^^^^^
:category: Locations :call-seq: keyword_loc -> Location
super ^^^^^
super { 123 } ^^^^^
: () -> 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 13793 def accept(visitor) visitor.visit_forwarding_super_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 13800 def child_nodes [block] 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 13817 def compact_child_nodes compact = [] #: Array[Prism::node] if (block = self.block); compact << block; end compact end
(?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?block: BlockNode?) → ForwardingSuperNode
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node.rb, line 13829 def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, block: self.block) ForwardingSuperNode.new(source, node_id, location, flags, keyword_loc, block) end
Creates a copy of self with the given fields, using self as the template.
:call-seq: copy(**fields) -> ForwardingSuperNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?block: BlockNode?) -> ForwardingSuperNode
() → 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 13808 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? if (block = self.block); yield block; 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 13893 def save_keyword_loc(repository) repository.enter(node_id, :keyword_loc) end
Save the keyword_loc location using the given saved source so that it can be retrieved later.
:category: Repository Save the keyword_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 13915 def keyword keyword_loc.slice end
Slice the location of keyword_loc from the source.
:call-seq: keyword -> String
Slice the location of keyword_loc from the source.
: () -> String