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[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) -> 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.
6744 6745 6746 6747 6748 6749 |
# File 'lib/prism/node.rb', line 6744 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`.
6795 6796 6797 |
# File 'lib/prism/node.rb', line 6795 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.
6801 6802 6803 |
# File 'lib/prism/node.rb', line 6801 def ===(other) other.is_a?(FalseNode) end |
#accept(visitor) ⇒ Object
def accept: (Visitor visitor) -> void
6752 6753 6754 |
# File 'lib/prism/node.rb', line 6752 def accept(visitor) visitor.visit_false_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
6757 6758 6759 |
# File 'lib/prism/node.rb', line 6757 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
6767 6768 6769 |
# File 'lib/prism/node.rb', line 6767 def comment_targets [] #: Array[Prism::node | Location] end |
#compact_child_nodes ⇒ Object
def compact_child_nodes: () -> Array
6762 6763 6764 |
# File 'lib/prism/node.rb', line 6762 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
6772 6773 6774 |
# File 'lib/prism/node.rb', line 6772 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 }
6780 6781 6782 |
# File 'lib/prism/node.rb', line 6780 def deconstruct_keys(keys) { node_id: node_id, location: location } end |
#inspect ⇒ Object
def inspect -> String
6785 6786 6787 |
# File 'lib/prism/node.rb', line 6785 def inspect InspectVisitor.compose(self) end |
#type ⇒ Object
Return a symbol representation of this node type. See ‘Node#type`.
6790 6791 6792 |
# File 'lib/prism/node.rb', line 6790 def type :false_node end |