class YARP::NumberedReferenceReadNode
Represents reading a numbered reference to a capture in the previous match.
$1 ^^
Attributes
number[R]
attr_reader number: Integer
Public Class Methods
new(number, location)
click to toggle source
def initialize: (number: Integer, location: Location
) -> void
# File yarp/node.rb, line 7905 def initialize(number, location) @number = number @location = location end
Public Instance Methods
accept(visitor)
click to toggle source
def accept: (visitor: Visitor
) -> void
# File yarp/node.rb, line 7911 def accept(visitor) visitor.visit_numbered_reference_read_node(self) end
child_nodes()
click to toggle source
def child_nodes
: () -> Array[nil | Node]
# File yarp/node.rb, line 7916 def child_nodes [] end
Also aliased as: deconstruct
comment_targets()
click to toggle source
def comment_targets
: () -> Array[Node | Location]
# File yarp/node.rb, line 7921 def comment_targets [] end
copy(**params)
click to toggle source
def copy: (**params) -> NumberedReferenceReadNode
# File yarp/node.rb, line 7926 def copy(**params) NumberedReferenceReadNode.new( params.fetch(:number) { number }, params.fetch(:location) { location }, ) end
deconstruct_keys(keys)
click to toggle source
inspect(inspector = NodeInspector.new)
click to toggle source
# File yarp/node.rb, line 7941 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "└── number: #{number.inspect}\n" inspector.to_str end