Class: Prism::FalseNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::FalseNode
- Defined in:
- lib/prism/node.rb,
ext/prism/api_node.c
Overview
Represents the use of the literal ‘false` keyword.
false
^^^^^
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.
-
#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) -> FalseNode.
-
#deconstruct_keys(keys) ⇒ Object
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }.
-
#initialize(source, node_id, location, flags) ⇒ FalseNode
constructor
Initialize a new FalseNode node.
-
#inspect ⇒ Object
def inspect -> String.
-
#type ⇒ Object
Return a symbol representation of this node type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ FalseNode
Initialize a new FalseNode node.
6774 6775 6776 6777 6778 6779 |
# File 'lib/prism/node.rb', line 6774 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`.
6825 6826 6827 |
# File 'lib/prism/node.rb', line 6825 def self.type :false_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.
6831 6832 6833 |
# File 'lib/prism/node.rb', line 6831 def ===(other) other.is_a?(FalseNode) end |
#accept(visitor) ⇒ Object
def accept: (Visitor visitor) -> void
6782 6783 6784 |
# File 'lib/prism/node.rb', line 6782 def accept(visitor) visitor.visit_false_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array
6787 6788 6789 |
# File 'lib/prism/node.rb', line 6787 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
6797 6798 6799 |
# File 'lib/prism/node.rb', line 6797 def comment_targets [] #: Array[Prism::node | Location] end |
#compact_child_nodes ⇒ Object
def compact_child_nodes: () -> Array
6792 6793 6794 |
# File 'lib/prism/node.rb', line 6792 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) -> FalseNode
6802 6803 6804 |
# File 'lib/prism/node.rb', line 6802 def copy(node_id: self.node_id, location: self.location, flags: self.flags) FalseNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Object
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }
6810 6811 6812 |
# File 'lib/prism/node.rb', line 6810 def deconstruct_keys(keys) { node_id: node_id, location: location } end |
#inspect ⇒ Object
def inspect -> String
6815 6816 6817 |
# File 'lib/prism/node.rb', line 6815 def inspect InspectVisitor.compose(self) end |
#type ⇒ Object
Return a symbol representation of this node type. See ‘Node#type`.
6820 6821 6822 |
# File 'lib/prism/node.rb', line 6820 def type :false_node end |