Class: Prism::RedoNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::RedoNode
- Defined in:
- lib/prism/node.rb,
sig/generated/prism/node.rbs,
ext/prism/api_node.c
Overview
Class Method Summary collapse
-
.type ⇒ :redo_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) ⇒ RedoNode
:call-seq: copy(**fields) -> RedoNode.
-
#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) ⇒ RedoNode
constructor
Initialize a new RedoNode node.
-
#inspect ⇒ String
: () -> String.
-
#type ⇒ :redo_node
See
Node#type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ RedoNode
Initialize a new RedoNode node.
: (Source source, Integer node_id, Location location, Integer flags, ) -> void
28010 28011 28012 28013 28014 28015 |
# File 'lib/prism/node.rb', line 28010 def initialize(source, node_id, location, flags) @source = source @node_id = node_id @location = location @flags = flags end |
Class Method Details
.type ⇒ :redo_node
See Node.type.
: () -> :redo_node
28092 28093 28094 |
# File 'lib/prism/node.rb', line 28092 def self.type :redo_node end |
Instance Method Details
#===(other) ⇒ boolish
: (untyped other) -> boolish
28108 28109 28110 |
# File 'lib/prism/node.rb', line 28108 def ===(other) # :nodoc: other.is_a?(RedoNode) end |
#accept(visitor) ⇒ Object
See Node.accept.
: (_Visitor visitor) -> untyped
28031 28032 28033 |
# File 'lib/prism/node.rb', line 28031 def accept(visitor) visitor.visit_redo_node(self) end |
#child_nodes ⇒ Array[node?] Also known as: deconstruct
See Node.child_nodes.
: () -> Array
28038 28039 28040 |
# File 'lib/prism/node.rb', line 28038 def child_nodes [] end |
#compact_child_nodes ⇒ Array[node]
See Node.compact_child_nodes.
: () -> Array
28054 28055 28056 |
# File 'lib/prism/node.rb', line 28054 def compact_child_nodes [] end |
#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ RedoNode
:call-seq:
copy(**fields) -> RedoNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> RedoNode
28064 28065 28066 |
# File 'lib/prism/node.rb', line 28064 def copy(node_id: self.node_id, location: self.location, flags: self.flags) RedoNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped]
28071 28072 28073 28074 28075 28076 28077 28078 28079 28080 |
# File 'lib/prism/node.rb', line 28071 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
28046 28047 28048 28049 |
# File 'lib/prism/node.rb', line 28046 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? end |
#inspect ⇒ String
: () -> String
28097 28098 28099 |
# File 'lib/prism/node.rb', line 28097 def inspect # :nodoc: InspectVisitor.compose(self) end |
#type ⇒ :redo_node
See Node#type.
: () -> :redo_node
28085 28086 28087 |
# File 'lib/prism/node.rb', line 28085 def type :redo_node end |