class Prism::ImaginaryNode
Repräsentiert ein imaginäres Zahl-Literal.
1.0i ^^^^
Attribute
attr_reader numeric: FloatNode | IntegerNode | RationalNode
Öffentliche Klassenmethoden
Source
# File lib/prism/node.rb, line 8797 def initialize(source, node_id, location, flags, numeric) @source = source @node_id = node_id @location = location @flags = flags @numeric = numeric end
Initialisiert einen neuen ImaginaryNode.
Source
# File lib/prism/node.rb, line 8852 def self.type :imaginary_node end
Gibt eine symbolische Darstellung dieses Knotentyps zurück. Siehe Node::type.
Öffentliche Instanzmethoden
Source
# File lib/prism/node.rb, line 8858 def ===(other) other.is_a?(ImaginaryNode) && (numeric === other.numeric) 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 8806 def accept(visitor) visitor.visit_imaginary_node(self) end
def accept: (Visitor visitor) -> void
Source
# File lib/prism/node.rb, line 8811 def child_nodes [numeric] end
def child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 8821 def comment_targets [numeric] #: Array[Prism::node | Location] end
def comment_targets: () -> Array[Node | Location]
Source
# File lib/prism/node.rb, line 8816 def compact_child_nodes [numeric] end
def compact_child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 8826 def copy(node_id: self.node_id, location: self.location, flags: self.flags, numeric: self.numeric) ImaginaryNode.new(source, node_id, location, flags, numeric) end
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: FloatNode | IntegerNode | RationalNode) -> ImaginaryNode
Source
# File lib/prism/node.rb, line 8834 def deconstruct_keys(keys) { node_id: node_id, location: location, numeric: numeric } end
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, numeric: FloatNode | IntegerNode | RationalNode }
Source
# File lib/prism/node.rb, line 8842 def inspect InspectVisitor.compose(self) end
def inspect -> String
Source
# File lib/prism/node.rb, line 8847 def type :imaginary_node end
Gibt eine symbolische Darstellung dieses Knotentyps zurück. Siehe Node#type.