Class: Prism::RedoNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::RedoNode
- Defined in:
- lib/prism/node.rb,
ext/prism/api_node.c
Overview
Represents the use of the ‘redo` keyword.
redo
^^^^
Class Method Summary collapse
-
.type ⇒ Object
Return a symbol representation of this node type.
Instance Method Summary collapse
-
#===(other) ⇒ Object
Implements case-equality for the node.
-
#accept(visitor) ⇒ Object
def accept: (Visitor visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location].
-
#compact_child_nodes ⇒ Object
def compact_child_nodes: () -> Array.
-
#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ Object
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode.
-
#deconstruct_keys(keys) ⇒ Object
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }.
-
#initialize(source, node_id, location, flags) ⇒ RedoNode
constructor
Initialize a new RedoNode node.
-
#inspect ⇒ Object
def inspect -> String.
-
#type ⇒ Object
Return a symbol representation of this node type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ RedoNode
Initialize a new RedoNode node.
15177 15178 15179 15180 15181 15182 |
# File 'lib/prism/node.rb', line 15177 def initialize(source, node_id, location, flags) @source = source @node_id = node_id @location = location @flags = flags end |
Class Method Details
.type ⇒ Object
Return a symbol representation of this node type. See ‘Node::type`.
15228 15229 15230 |
# File 'lib/prism/node.rb', line 15228 def self.type :redo_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.
15234 15235 15236 |
# File 'lib/prism/node.rb', line 15234 def ===(other) other.is_a?(RedoNode) end |
#accept(visitor) ⇒ Object
def accept: (Visitor visitor) -> void
15185 15186 15187 |
# File 'lib/prism/node.rb', line 15185 def accept(visitor) visitor.visit_redo_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
15190 15191 15192 |
# File 'lib/prism/node.rb', line 15190 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
15200 15201 15202 |
# File 'lib/prism/node.rb', line 15200 def comment_targets [] #: Array[Prism::node | Location] end |
#compact_child_nodes ⇒ Object
def compact_child_nodes: () -> Array
15195 15196 15197 |
# File 'lib/prism/node.rb', line 15195 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) -> RedoNode
15205 15206 15207 |
# File 'lib/prism/node.rb', line 15205 def copy(node_id: self.node_id, location: self.location, flags: self.flags) RedoNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Object
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }
15213 15214 15215 |
# File 'lib/prism/node.rb', line 15213 def deconstruct_keys(keys) { node_id: node_id, location: location } end |
#inspect ⇒ Object
def inspect -> String
15218 15219 15220 |
# File 'lib/prism/node.rb', line 15218 def inspect InspectVisitor.compose(self) end |
#type ⇒ Object
Return a symbol representation of this node type. See ‘Node#type`.
15223 15224 15225 |
# File 'lib/prism/node.rb', line 15223 def type :redo_node end |