Class: Prism::ItLocalVariableReadNode
- Inherits:
-
PrismNode
- Object
- PrismNode
- Prism::ItLocalVariableReadNode
- Defined in:
- lib/prism/node.rb,
sig/generated/prism/node.rbs,
ext/prism/api_node.c
Overview
Class Method Summary collapse
-
.type ⇒ :it_local_variable_read_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) ⇒ ItLocalVariableReadNode
:call-seq: copy(**fields) -> ItLocalVariableReadNode.
-
#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) ⇒ ItLocalVariableReadNode
constructor
Initialize a new ItLocalVariableReadNode node.
-
#inspect ⇒ String
: () -> String.
-
#type ⇒ :it_local_variable_read_node
See
Node#type.
Constructor Details
#initialize(source, node_id, location, flags) ⇒ ItLocalVariableReadNode
Initialize a new ItLocalVariableReadNode node.
: (Source source, Integer node_id, Location location, Integer flags, ) -> void
20531 20532 20533 20534 20535 20536 |
# File 'lib/prism/node.rb', line 20531 def initialize(source, node_id, location, flags) @source = source @node_id = node_id @location = location @flags = flags end |
Class Method Details
.type ⇒ :it_local_variable_read_node
See Node.type.
: () -> :it_local_variable_read_node
20613 20614 20615 |
# File 'lib/prism/node.rb', line 20613 def self.type :it_local_variable_read_node end |
Instance Method Details
#===(other) ⇒ boolish
: (untyped other) -> boolish
20629 20630 20631 |
# File 'lib/prism/node.rb', line 20629 def ===(other) # :nodoc: other.is_a?(ItLocalVariableReadNode) end |
#accept(visitor) ⇒ Object
See Node.accept.
: (_Visitor visitor) -> untyped
20552 20553 20554 |
# File 'lib/prism/node.rb', line 20552 def accept(visitor) visitor.visit_it_local_variable_read_node(self) end |
#child_nodes ⇒ Array[node?] Also known as: deconstruct
See Node.child_nodes.
: () -> Array
20559 20560 20561 |
# File 'lib/prism/node.rb', line 20559 def child_nodes [] end |
#compact_child_nodes ⇒ Array[node]
See Node.compact_child_nodes.
: () -> Array
20575 20576 20577 |
# File 'lib/prism/node.rb', line 20575 def compact_child_nodes [] end |
#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ ItLocalVariableReadNode
:call-seq:
copy(**fields) -> ItLocalVariableReadNode
Creates a copy of self with the given fields, using self as the template.
: (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> ItLocalVariableReadNode
20585 20586 20587 |
# File 'lib/prism/node.rb', line 20585 def copy(node_id: self.node_id, location: self.location, flags: self.flags) ItLocalVariableReadNode.new(source, node_id, location, flags) end |
#deconstruct_keys(keys) ⇒ Hash[Symbol, untyped]
: (Array? keys) -> Hash[Symbol, untyped]
20592 20593 20594 20595 20596 20597 20598 20599 20600 20601 |
# File 'lib/prism/node.rb', line 20592 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
20567 20568 20569 20570 |
# File 'lib/prism/node.rb', line 20567 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? end |
#inspect ⇒ String
: () -> String
20618 20619 20620 |
# File 'lib/prism/node.rb', line 20618 def inspect # :nodoc: InspectVisitor.compose(self) end |
#type ⇒ :it_local_variable_read_node
See Node#type.
: () -> :it_local_variable_read_node
20606 20607 20608 |
# File 'lib/prism/node.rb', line 20606 def type :it_local_variable_read_node end |