Class: Prism::ForwardingParameterNode

Inherits:
PrismNode
  • Object
show all
Defined in:
lib/prism/node.rb,
ext/prism/api_node.c

Overview

Represents the use of the forwarding parameter in a method, block, or lambda declaration.

def foo(...)
        ^^^
end

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, node_id, location, flags) ⇒ ForwardingParameterNode

Initialize a new ForwardingParameterNode node.



6481
6482
6483
6484
6485
6486
# File 'lib/prism/node.rb', line 6481

def initialize(source, node_id, location, flags)
  @source = source
  @node_id = node_id
  @location = location
  @flags = flags
end

Class Method Details

.typeObject

Return a symbol representation of this node type. See ‘Node::type`.



6532
6533
6534
# File 'lib/prism/node.rb', line 6532

def self.type
  :forwarding_parameter_node
end

Instance Method Details

#===(other) ⇒ Object

Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.



6538
6539
6540
# File 'lib/prism/node.rb', line 6538

def ===(other)
  other.is_a?(ForwardingParameterNode)
end

#accept(visitor) ⇒ Object

def accept: (Visitor visitor) -> void



6489
6490
6491
# File 'lib/prism/node.rb', line 6489

def accept(visitor)
  visitor.visit_forwarding_parameter_node(self)
end

#child_nodesObject Also known as: deconstruct

def child_nodes: () -> Array[nil | Node]



6494
6495
6496
# File 'lib/prism/node.rb', line 6494

def child_nodes
  []
end

#comment_targetsObject

def comment_targets: () -> Array[Node | Location]



6504
6505
6506
# File 'lib/prism/node.rb', line 6504

def comment_targets
  [] #: Array[Prism::node | Location]
end

#compact_child_nodesObject

def compact_child_nodes: () -> Array



6499
6500
6501
# File 'lib/prism/node.rb', line 6499

def compact_child_nodes
  []
end

#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ Object

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode



6509
6510
6511
# File 'lib/prism/node.rb', line 6509

def copy(node_id: self.node_id, location: self.location, flags: self.flags)
  ForwardingParameterNode.new(source, node_id, location, flags)
end

#deconstruct_keys(keys) ⇒ Object

def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }



6517
6518
6519
# File 'lib/prism/node.rb', line 6517

def deconstruct_keys(keys)
  { node_id: node_id, location: location }
end

#inspectObject

def inspect -> String



6522
6523
6524
# File 'lib/prism/node.rb', line 6522

def inspect
  InspectVisitor.compose(self)
end

#typeObject

Return a symbol representation of this node type. See ‘Node#type`.



6527
6528
6529
# File 'lib/prism/node.rb', line 6527

def type
  :forwarding_parameter_node
end