Class: Prism::RetryNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::RetryNode
- Defined in:
- lib/prism/node.rb,
sig/generated/prism/node.rbs,
ext/prism/api_node.c
Overview
Class Method Summary collapse
-
.type ⇒ :retry_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) ⇒ RetryNode
:call-seq: copy(**fields) -> RetryNode.
-
#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) ⇒ RetryNode
constructor
Initialize a new RetryNode node.
-
#inspect ⇒ String
: () -> String.
-
#type ⇒ :retry_node
See
Node#type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ RetryNode
Initialize a new RetryNode node.
: (Source source, Integer node_id, Location location, Integer flags, ) -> void
29461 29462 29463 29464 29465 29466 |
# File 'lib/prism/node.rb', line 29461 def initialize(source, node_id, location, flags) @source = source @node_id = node_id @location = location @flags = flags end |
Class Method Details
.type ⇒ :retry_node
See Node.type.
: () -> :retry_node
29543 29544 29545 |
# File 'lib/prism/node.rb', line 29543 def self.type :retry_node end |
Instance Method Details
#===(other) ⇒ boolish
: (untyped other) -> boolish
29559 29560 29561 |
# File 'lib/prism/node.rb', line 29559 def ===(other) # :nodoc: other.is_a?(RetryNode) end |
#accept(visitor) ⇒ Object
See Node.accept.
: (_Visitor visitor) -> untyped
29482 29483 29484 |
# File 'lib/prism/node.rb', line 29482 def accept(visitor) visitor.visit_retry_node(self) end |
#child_nodes ⇒ Array[node?] Also known as: deconstruct
See Node.child_nodes.
: () -> Array
29489 29490 29491 |
# File 'lib/prism/node.rb', line 29489 def child_nodes [] end |
#compact_child_nodes ⇒ Array[node]
See Node.compact_child_nodes.
: () -> Array
29505 29506 29507 |
# File 'lib/prism/node.rb', line 29505 def compact_child_nodes [] end |
#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ RetryNode
:call-seq:
copy(**fields) -> RetryNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> RetryNode
29515 29516 29517 |
# File 'lib/prism/node.rb', line 29515 def copy(node_id: self.node_id, location: self.location, flags: self.flags) RetryNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped]
29522 29523 29524 29525 29526 29527 29528 29529 29530 29531 |
# File 'lib/prism/node.rb', line 29522 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
29497 29498 29499 29500 |
# File 'lib/prism/node.rb', line 29497 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? end |
#inspect ⇒ String
: () -> String
29548 29549 29550 |
# File 'lib/prism/node.rb', line 29548 def inspect # :nodoc: InspectVisitor.compose(self) end |
#type ⇒ :retry_node
See Node#type.
: () -> :retry_node
29536 29537 29538 |
# File 'lib/prism/node.rb', line 29536 def type :retry_node end |