Class: Prism::ForwardingParameterNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::ForwardingParameterNode
- Defined in:
- lib/prism/node.rb,
sig/generated/prism/node.rbs,
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
-
.type ⇒ :forwarding_parameter_node
See
Node.type.
Instance Method Summary collapse
-
#===(other) ⇒ boolish
: (untyped other) -> boolish.
-
#accept(visitor) ⇒ Object
See Node.accept.
-
#child_nodes ⇒ Array[node?]
(also: #deconstruct)
See Node.child_nodes.
-
#compact_child_nodes ⇒ Array[node]
See Node.compact_child_nodes.
-
#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ ForwardingParameterNode
:call-seq: copy(**fields) -> ForwardingParameterNode.
-
#deconstruct_keys(keys) ⇒ Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped].
-
#each_child_node {|arg0| ... } ⇒ Object
See Node.each_child_node.
-
#initialize(source, node_id, location, flags) ⇒ ForwardingParameterNode
constructor
Initialize a new ForwardingParameterNode node.
-
#inspect ⇒ String
: () -> String.
-
#type ⇒ :forwarding_parameter_node
See
Node#type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ ForwardingParameterNode
Initialize a new ForwardingParameterNode node.
: (Source source, Integer node_id, Location location, Integer flags, ) -> void
13647 13648 13649 13650 13651 13652 |
# File 'lib/prism/node.rb', line 13647 def initialize(source, node_id, location, flags) @source = source @node_id = node_id @location = location @flags = flags end |
Class Method Details
.type ⇒ :forwarding_parameter_node
See Node.type.
: () -> :forwarding_parameter_node
13729 13730 13731 |
# File 'lib/prism/node.rb', line 13729 def self.type :forwarding_parameter_node end |
Instance Method Details
#===(other) ⇒ boolish
: (untyped other) -> boolish
13745 13746 13747 |
# File 'lib/prism/node.rb', line 13745 def ===(other) # :nodoc: other.is_a?(ForwardingParameterNode) end |
#accept(visitor) ⇒ Object
See Node.accept.
: (_Visitor visitor) -> untyped
13668 13669 13670 |
# File 'lib/prism/node.rb', line 13668 def accept(visitor) visitor.visit_forwarding_parameter_node(self) end |
#child_nodes ⇒ Array[node?] Also known as: deconstruct
See Node.child_nodes.
: () -> Array
13675 13676 13677 |
# File 'lib/prism/node.rb', line 13675 def child_nodes [] end |
#compact_child_nodes ⇒ Array[node]
See Node.compact_child_nodes.
: () -> Array
13691 13692 13693 |
# File 'lib/prism/node.rb', line 13691 def compact_child_nodes [] end |
#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ ForwardingParameterNode
:call-seq:
copy(**fields) -> ForwardingParameterNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> ForwardingParameterNode
13701 13702 13703 |
# File 'lib/prism/node.rb', line 13701 def copy(node_id: self.node_id, location: self.location, flags: self.flags) ForwardingParameterNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped]
13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 |
# File 'lib/prism/node.rb', line 13708 def deconstruct_keys(keys) # :nodoc: (keys || %i[node_id location]).each_with_object( {} #: Hash[Symbol, untyped] ) do |key, deconstructed| case key when :node_id then deconstructed[:node_id] = self.node_id when :location then deconstructed[:location] = self.location end end end |
#each_child_node ⇒ Enumerator[node, void] #each_child_node ⇒ void
See Node.each_child_node.
: () -> Enumerator[node, void] : () { (node) -> void } -> void
13683 13684 13685 13686 |
# File 'lib/prism/node.rb', line 13683 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? end |
#inspect ⇒ String
: () -> String
13734 13735 13736 |
# File 'lib/prism/node.rb', line 13734 def inspect # :nodoc: InspectVisitor.compose(self) end |
#type ⇒ :forwarding_parameter_node
See Node#type.
: () -> :forwarding_parameter_node
13722 13723 13724 |
# File 'lib/prism/node.rb', line 13722 def type :forwarding_parameter_node end |