class Prism::ForwardingSuperNode
Stellt die Verwendung des Schlüsselworts super ohne Klammern oder Argumente dar, die aber möglicherweise einen Block hat.
super
^^^^^
super { 123 }
^^^^^^^^^^^^^
Wenn es andere Argumente hätte, wäre es stattdessen ein SuperNode.
Attribute
Alle anderen Argumente werden wie gewohnt weitergeleitet, außer der ursprüngliche Block wird durch den neuen Block ersetzt.
Öffentliche Klassenmethoden
Source
# File lib/prism/node.rb, line 7582 def initialize(source, node_id, location, flags, block) @source = source @node_id = node_id @location = location @flags = flags @block = block end
Initialisiert einen neuen ForwardingSuperNode-Knoten.
Source
# File lib/prism/node.rb, line 7639 def self.type :forwarding_super_node end
Gibt eine symbolische Darstellung dieses Knotentyps zurück. Siehe Node::type.
Öffentliche Instanzmethoden
Source
# File lib/prism/node.rb, line 7645 def ===(other) other.is_a?(ForwardingSuperNode) && (block === other.block) end
Implementiert die Fallgleichheit für den Knoten. Dies ist effektiv ==, aber ohne den Wert von Standorten zu vergleichen. Standorte werden nur auf Anwesenheit geprüft.
Source
# File lib/prism/node.rb, line 7591 def accept(visitor) visitor.visit_forwarding_super_node(self) end
def accept: (Visitor visitor) -> void
Source
# File lib/prism/node.rb, line 7596 def child_nodes [block] end
def child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 7608 def comment_targets [*block] #: Array[Prism::node | Location] end
def comment_targets: () -> Array[Node | Location]
Source
# File lib/prism/node.rb, line 7601 def compact_child_nodes compact = [] #: Array[Prism::node] compact << block if block compact end
def compact_child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 7613 def copy(node_id: self.node_id, location: self.location, flags: self.flags, block: self.block) ForwardingSuperNode.new(source, node_id, location, flags, block) end
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode
Source
# File lib/prism/node.rb, line 7621 def deconstruct_keys(keys) { node_id: node_id, location: location, block: block } end
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, block: BlockNode? }
Source
# File lib/prism/node.rb, line 7629 def inspect InspectVisitor.compose(self) end
def inspect -> String