class Prism::IntegerNode
Представляет литерал целого числа.
1 ^
Атрибуты
Значение литерала целого числа.
Открытые методы класса
# File lib/prism/node.rb, line 10490 def initialize(source, node_id, location, flags, value) @source = source @node_id = node_id @location = location @flags = flags @value = value end
Инициализирует новый узел IntegerNode.
# File lib/prism/node.rb, line 10565 def self.type :integer_node end
Возвращает символьное представление типа этого узла. См. Node::type.
Открытые методы экземпляра
# File lib/prism/node.rb, line 10571
def ===(other)
other.is_a?(IntegerNode) &&
(flags === other.flags) &&
(value === other.value)
end Реализует для узла сравнение на соответствие. По сути, это ==, но без сравнения значений расположений. Проверяется только наличие расположений.
# File lib/prism/node.rb, line 10499 def accept(visitor) visitor.visit_integer_node(self) end
def accept: (Visitor visitor) -> void
# File lib/prism/node.rb, line 10532 def binary? flags.anybits?(IntegerBaseFlags::BINARY) end
def binary?: () -> bool
# File lib/prism/node.rb, line 10504 def child_nodes [] end
def child_nodes: () -> Array
# File lib/prism/node.rb, line 10514 def comment_targets [] #: Array[Prism::node | Location] end
def comment_targets: () -> Array[Node | Location]
# File lib/prism/node.rb, line 10509 def compact_child_nodes [] end
def compact_child_nodes: () -> Array
# File lib/prism/node.rb, line 10519 def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value) IntegerNode.new(source, node_id, location, flags, value) end
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode
# File lib/prism/node.rb, line 10537 def decimal? flags.anybits?(IntegerBaseFlags::DECIMAL) end
def decimal?: () -> bool
# File lib/prism/node.rb, line 10527
def deconstruct_keys(keys)
{ node_id: node_id, location: location, value: value }
end def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, value: Integer }
# File lib/prism/node.rb, line 10547 def hexadecimal? flags.anybits?(IntegerBaseFlags::HEXADECIMAL) end
def hexadecimal?: () -> bool
# File lib/prism/node.rb, line 10555 def inspect InspectVisitor.compose(self) end
def inspect -> String
# File lib/prism/node.rb, line 10542 def octal? flags.anybits?(IntegerBaseFlags::OCTAL) end
def octal?: () -> bool
# File lib/prism/node.rb, line 10560 def type :integer_node end
Возвращает символьное представление типа этого узла. См. Node#type.
Ruby Core © 1993–2025 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.