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.



6518
6519
6520
6521
6522
6523
# File 'lib/prism/node.rb', line 6518

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`.



6569
6570
6571
# File 'lib/prism/node.rb', line 6569

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.



6575
6576
6577
# File 'lib/prism/node.rb', line 6575

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

#accept(visitor) ⇒ Object

def accept: (Visitor visitor) -> void



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

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

#child_nodesObject Also known as: deconstruct

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



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

def child_nodes
  []
end

#comment_targetsObject

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



6541
6542
6543
# File 'lib/prism/node.rb', line 6541

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

#compact_child_nodesObject

def compact_child_nodes: () -> Array



6536
6537
6538
# File 'lib/prism/node.rb', line 6536

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



6546
6547
6548
# File 'lib/prism/node.rb', line 6546

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 }



6554
6555
6556
# File 'lib/prism/node.rb', line 6554

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

#inspectObject

def inspect -> String



6559
6560
6561
# File 'lib/prism/node.rb', line 6559

def inspect
  InspectVisitor.compose(self)
end

#typeObject

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



6564
6565
6566
# File 'lib/prism/node.rb', line 6564

def type
  :forwarding_parameter_node
end