class Prism::LocalVariableTargetNode
Представляет запись в локальную переменную в контексте, в котором нет явного значения.
foo, bar = baz
^^^ ^^^
foo => baz
^^^ Атрибуты
Открытые методы класса
# File lib/prism/node.rb, line 12234 def initialize(source, node_id, location, flags, name, depth) @source = source @node_id = node_id @location = location @flags = flags @name = name @depth = depth end
Инициализирует новый узел LocalVariableTargetNode.
# File lib/prism/node.rb, line 12293 def self.type :local_variable_target_node end
Возвращает символьное представление типа этого узла. См. Node::type.
Открытые методы экземпляра
# File lib/prism/node.rb, line 12299
def ===(other)
other.is_a?(LocalVariableTargetNode) &&
(name === other.name) &&
(depth === other.depth)
end Реализует проверку равенства с образцом для узла. По сути, это ==, но без сравнения значений расположений. Проверяется только наличие расположений.
# File lib/prism/node.rb, line 12244 def accept(visitor) visitor.visit_local_variable_target_node(self) end
def accept: (Visitor visitor) -> void
# File lib/prism/node.rb, line 12249 def child_nodes [] end
def child_nodes: () -> Array
# File lib/prism/node.rb, line 12259 def comment_targets [] #: Array[Prism::node | Location] end
def comment_targets: () -> Array[Node | Location]
# File lib/prism/node.rb, line 12254 def compact_child_nodes [] end
def compact_child_nodes: () -> Array
# File lib/prism/node.rb, line 12264 def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, depth: self.depth) LocalVariableTargetNode.new(source, node_id, location, flags, name, depth) end
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode
# File lib/prism/node.rb, line 12272
def deconstruct_keys(keys)
{ node_id: node_id, location: location, name: name, depth: depth }
end def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer }
# File lib/prism/node.rb, line 12283 def inspect InspectVisitor.compose(self) end
def inspect -> String
# File lib/prism/node.rb, line 12288 def type :local_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.