Class: Prism::ItParametersNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::ItParametersNode
- Defined in:
- lib/prism/node.rb,
ext/prism/api_node.c
Overview
Represents an implicit set of parameters through the use of the it keyword within a block or lambda.
-> { it + it }
^^^^^^^^^^^^^^
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) -> ItParametersNode.
-
#deconstruct_keys(keys) ⇒ Object
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }.
-
#each_child_node ⇒ Object
def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator.
-
#initialize(source, node_id, location, flags) ⇒ ItParametersNode
constructor
Initialize a new ItParametersNode node.
-
#inspect ⇒ Object
def inspect -> String.
-
#type ⇒ Object
Return a symbol representation of this node type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ ItParametersNode
Initialize a new ItParametersNode node.
12072 12073 12074 12075 12076 12077 |
# File 'lib/prism/node.rb', line 12072 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.
12129 12130 12131 |
# File 'lib/prism/node.rb', line 12129 def self.type :it_parameters_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.
12135 12136 12137 |
# File 'lib/prism/node.rb', line 12135 def ===(other) other.is_a?(ItParametersNode) end |
#accept(visitor) ⇒ Object
def accept: (Visitor visitor) -> void
12080 12081 12082 |
# File 'lib/prism/node.rb', line 12080 def accept(visitor) visitor.visit_it_parameters_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array
12085 12086 12087 |
# File 'lib/prism/node.rb', line 12085 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
12101 12102 12103 |
# File 'lib/prism/node.rb', line 12101 def comment_targets [] #: Array[Prism::node | Location] end |
#compact_child_nodes ⇒ Object
def compact_child_nodes: () -> Array
12096 12097 12098 |
# File 'lib/prism/node.rb', line 12096 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) -> ItParametersNode
12106 12107 12108 |
# File 'lib/prism/node.rb', line 12106 def copy(node_id: self.node_id, location: self.location, flags: self.flags) ItParametersNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Object
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }
12114 12115 12116 |
# File 'lib/prism/node.rb', line 12114 def deconstruct_keys(keys) { node_id: node_id, location: location } end |
#each_child_node ⇒ Object
def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator
12090 12091 12092 12093 |
# File 'lib/prism/node.rb', line 12090 def each_child_node return to_enum(:each_child_node) unless block_given? end |
#inspect ⇒ Object
def inspect -> String
12119 12120 12121 |
# File 'lib/prism/node.rb', line 12119 def inspect InspectVisitor.compose(self) end |
#type ⇒ Object
Return a symbol representation of this node type. See ‘Node#type`.
12124 12125 12126 |
# File 'lib/prism/node.rb', line 12124 def type :it_parameters_node end |