Class: Prism::RetryNode

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

Overview

Represents the use of the ‘retry` keyword.

retry
^^^^^

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Initialize a new RetryNode node.


16005
16006
16007
16008
16009
16010
# File 'lib/prism/node.rb', line 16005

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


16056
16057
16058
# File 'lib/prism/node.rb', line 16056

def self.type
  :retry_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.


16062
16063
16064
# File 'lib/prism/node.rb', line 16062

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

#accept(visitor) ⇒ Object

def accept: (Visitor visitor) -> void


16013
16014
16015
# File 'lib/prism/node.rb', line 16013

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

#child_nodesObject Also known as: deconstruct

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


16018
16019
16020
# File 'lib/prism/node.rb', line 16018

def child_nodes
  []
end

#comment_targetsObject

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


16028
16029
16030
# File 'lib/prism/node.rb', line 16028

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

#compact_child_nodesObject

def compact_child_nodes: () -> Array


16023
16024
16025
# File 'lib/prism/node.rb', line 16023

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) -> RetryNode


16033
16034
16035
# File 'lib/prism/node.rb', line 16033

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

#deconstruct_keys(keys) ⇒ Object

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


16041
16042
16043
# File 'lib/prism/node.rb', line 16041

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

#inspectObject

def inspect -> String


16046
16047
16048
# File 'lib/prism/node.rb', line 16046

def inspect
  InspectVisitor.compose(self)
end

#typeObject

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


16051
16052
16053
# File 'lib/prism/node.rb', line 16051

def type
  :retry_node
end