Class: YARP::ImaginaryNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ImaginaryNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents an imaginary number literal.
1.0i
^^^^
Instance Attribute Summary collapse
-
#numeric ⇒ Object
readonly
attr_reader numeric: Node.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(numeric, location) ⇒ ImaginaryNode
constructor
def initialize: (numeric: Node, location: Location) -> void.
Constructor Details
#initialize(numeric, location) ⇒ ImaginaryNode
def initialize: (numeric: Node, location: Location) -> void
3005 3006 3007 3008 |
# File 'lib/yarp/node.rb', line 3005 def initialize(numeric, location) @numeric = numeric @location = location end |
Instance Attribute Details
#numeric ⇒ Object (readonly)
attr_reader numeric: Node
3002 3003 3004 |
# File 'lib/yarp/node.rb', line 3002 def numeric @numeric end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3011 3012 3013 |
# File 'lib/yarp/node.rb', line 3011 def accept(visitor) visitor.visit_imaginary_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3017 3018 3019 |
# File 'lib/yarp/node.rb', line 3017 def child_nodes [numeric] end |