Spec-Zone.ru › Ruby 3.4
  1. Prism::
  2. ClassVariableTargetNode

class Prism::ClassVariableTargetNode

Родительский класс:
Prism::Node

Представляет запись в переменную класса в контексте, не содержащем явного значения.

@@foo, @@bar = baz
^^^^^  ^^^^^

Атрибуты

name [R]

attr_reader name: Symbol

Общедоступные методы класса

new (source, node_id, location, flags, name) Показать исходный код
# File lib/prism/node.rb, line 4436
def initialize(source, node_id, location, flags, name)
  @source = source
  @node_id = node_id
  @location = location
  @flags = flags
  @name = name
end

Инициализирует новый узел ClassVariableTargetNode.

type () Показать исходный код
# File lib/prism/node.rb, line 4491
def self.type
  :class_variable_target_node
end

Возвращает символьное представление типа этого узла. См. Node::type.

Общедоступные методы экземпляра

=== (other) Показать исходный код
# File lib/prism/node.rb, line 4497
def ===(other)
  other.is_a?(ClassVariableTargetNode) &&
    (name === other.name)
end

Реализует сравнение на равенство с учётом case для узла. По сути, это ==, но без сравнения значений расположений. Проверяется только наличие расположений.

accept (visitor) Показать исходный код
# File lib/prism/node.rb, line 4445
def accept(visitor)
  visitor.visit_class_variable_target_node(self)
end

def accept: (Visitor visitor) -> void

child_nodes () Показать исходный код
# File lib/prism/node.rb, line 4450
def child_nodes
  []
end

def child_nodes: () -> Array

Также является псевдонимом: deconstruct
comment_targets () Показать исходный код
# File lib/prism/node.rb, line 4460
def comment_targets
  [] #: Array[Prism::node | Location]
end

def comment_targets: () -> Array[Node | Location]

compact_child_nodes () Показать исходный код
# File lib/prism/node.rb, line 4455
def compact_child_nodes
  []
end

def compact_child_nodes: () -> Array

copy (node_id: self.node_id, location: self.location, flags: self.flags, name: self.name) Показать исходный код
# File lib/prism/node.rb, line 4465
def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name)
  ClassVariableTargetNode.new(source, node_id, location, flags, name)
end

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode

deconstruct ()

def deconstruct: () -> Array

Псевдоним для: child_nodes
deconstruct_keys (keys) Показать исходный код
# File lib/prism/node.rb, line 4473
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 }

inspect () Показать исходный код
# File lib/prism/node.rb, line 4481
def inspect
  InspectVisitor.compose(self)
end

def inspect -> String

type () Показать исходный код
# File lib/prism/node.rb, line 4486
def type
  :class_variable_target_node
end

Возвращает символьное представление типа этого узла. См. Node#type.

Ruby Core © 1993–2025 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API