Class: Prism::FalseNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::FalseNode
- Defined in:
- lib/prism/node.rb,
sig/generated/prism/node.rbs,
ext/prism/api_node.c
Overview
Class Method Summary collapse
-
.type ⇒ :false_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) ⇒ FalseNode
:call-seq: copy(**fields) -> FalseNode.
-
#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) ⇒ FalseNode
constructor
Initialize a new FalseNode node.
-
#inspect ⇒ String
: () -> String.
-
#type ⇒ :false_node
See
Node#type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ FalseNode
Initialize a new FalseNode node.
: (Source source, Integer node_id, Location location, Integer flags, ) -> void
12386 12387 12388 12389 12390 12391 |
# File 'lib/prism/node.rb', line 12386 def initialize(source, node_id, location, flags) @source = source @node_id = node_id @location = location @flags = flags end |
Class Method Details
.type ⇒ :false_node
See Node.type.
: () -> :false_node
12468 12469 12470 |
# File 'lib/prism/node.rb', line 12468 def self.type :false_node end |
Instance Method Details
#===(other) ⇒ boolish
: (untyped other) -> boolish
12484 12485 12486 |
# File 'lib/prism/node.rb', line 12484 def ===(other) # :nodoc: other.is_a?(FalseNode) end |
#accept(visitor) ⇒ Object
See Node.accept.
: (_Visitor visitor) -> untyped
12407 12408 12409 |
# File 'lib/prism/node.rb', line 12407 def accept(visitor) visitor.visit_false_node(self) end |
#child_nodes ⇒ Array[node?] Also known as: deconstruct
See Node.child_nodes.
: () -> Array
12414 12415 12416 |
# File 'lib/prism/node.rb', line 12414 def child_nodes [] end |
#compact_child_nodes ⇒ Array[node]
See Node.compact_child_nodes.
: () -> Array
12430 12431 12432 |
# File 'lib/prism/node.rb', line 12430 def compact_child_nodes [] end |
#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ FalseNode
:call-seq:
copy(**fields) -> FalseNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> FalseNode
12440 12441 12442 |
# File 'lib/prism/node.rb', line 12440 def copy(node_id: self.node_id, location: self.location, flags: self.flags) FalseNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped]
12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 |
# File 'lib/prism/node.rb', line 12447 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
12422 12423 12424 12425 |
# File 'lib/prism/node.rb', line 12422 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? end |
#inspect ⇒ String
: () -> String
12473 12474 12475 |
# File 'lib/prism/node.rb', line 12473 def inspect # :nodoc: InspectVisitor.compose(self) end |
#type ⇒ :false_node
See Node#type.
: () -> :false_node
12461 12462 12463 |
# File 'lib/prism/node.rb', line 12461 def type :false_node end |