class Prism::InstanceVariableReadNode
Repräsentiert die Referenzierung einer Instanzvariablen.
@foo ^^^^
Attribute
Der Name der Instanzvariablen, der aus einem @ gefolgt von einem Identifier besteht.
@x # name `:@x` @_test # name `:@_test`
Öffentliche Klassenmethoden
Source
# File lib/prism/node.rb, line 10248 def initialize(source, node_id, location, flags, name) @source = source @node_id = node_id @location = location @flags = flags @name = name end
Initialisiert einen neuen InstanceVariableReadNode Knoten.
Source
# File lib/prism/node.rb, line 10307 def self.type :instance_variable_read_node end
Gibt eine symbolische Darstellung dieses Knotentyps zurück. Siehe Node::type.
Öffentliche Instanzmethoden
Source
# File lib/prism/node.rb, line 10313 def ===(other) other.is_a?(InstanceVariableReadNode) && (name === other.name) end
Implementiert die Fallgleichheit für den Knoten. Dies ist effektiv ==, aber ohne den Wert von Standorten zu vergleichen. Standorte werden nur auf Anwesenheit geprüft.
Source
# File lib/prism/node.rb, line 10257 def accept(visitor) visitor.visit_instance_variable_read_node(self) end
def accept: (Visitor visitor) -> void
Source
# File lib/prism/node.rb, line 10262 def child_nodes [] end
def child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 10272 def comment_targets [] #: Array[Prism::node | Location] end
def comment_targets: () -> Array[Node | Location]
Source
# File lib/prism/node.rb, line 10267 def compact_child_nodes [] end
def compact_child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 10277 def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name) InstanceVariableReadNode.new(source, node_id, location, flags, name) end
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode
Source
# File lib/prism/node.rb, line 10285 def deconstruct_keys(keys) { node_id: node_id, location: location, name: name } end
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, name: Symbol }
Source
# File lib/prism/node.rb, line 10297 def inspect InspectVisitor.compose(self) end
def inspect -> String