class Prism::NumberedParametersNode
Представляет неявный набор параметров, заданный с помощью нумерованных параметров в блоке или лямбде.
-> { _1 + _2 }
^^^^^^^^^^^^^^ Атрибуты
attr_reader maximum: Integer
Открытые методы класса
# File lib/prism/node.rb, line 13816 def initialize(source, node_id, location, flags, maximum) @source = source @node_id = node_id @location = location @flags = flags @maximum = maximum end
Инициализирует новый узел NumberedParametersNode.
# File lib/prism/node.rb, line 13871 def self.type :numbered_parameters_node end
Возвращает символьное представление типа этого узла. См. Node::type.
Открытые методы экземпляра
# File lib/prism/node.rb, line 13877
def ===(other)
other.is_a?(NumberedParametersNode) &&
(maximum === other.maximum)
end Реализует проверку равенства для узла в конструкции case. По сути, это оператор ==, но без сравнения значений расположений. Проверяется только наличие расположений.
# File lib/prism/node.rb, line 13825 def accept(visitor) visitor.visit_numbered_parameters_node(self) end
def accept: (Visitor visitor) -> void
# File lib/prism/node.rb, line 13830 def child_nodes [] end
def child_nodes: () -> Array
# File lib/prism/node.rb, line 13840 def comment_targets [] #: Array[Prism::node | Location] end
def comment_targets: () -> Array[Node | Location]
# File lib/prism/node.rb, line 13835 def compact_child_nodes [] end
def compact_child_nodes: () -> Array
# File lib/prism/node.rb, line 13845 def copy(node_id: self.node_id, location: self.location, flags: self.flags, maximum: self.maximum) NumberedParametersNode.new(source, node_id, location, flags, maximum) end
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode
# File lib/prism/node.rb, line 13853
def deconstruct_keys(keys)
{ node_id: node_id, location: location, maximum: maximum }
end def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, maximum: Integer }
# File lib/prism/node.rb, line 13861 def inspect InspectVisitor.compose(self) end
def inspect -> String
# File lib/prism/node.rb, line 13866 def type :numbered_parameters_node end
Возвращает символьное представление типа этого узла. См. Node#type.
Ruby Core © 1993–2025 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.