class YARP::ImaginaryNode
Represents an imaginary number literal.
1.0i ^^^^
Attributes
numeric[R]
attr_reader numeric: Node
Public Class Methods
Public Instance Methods
accept(visitor)
click to toggle source
def accept: (visitor: Visitor
) -> void
# File yarp/node.rb, line 5282 def accept(visitor) visitor.visit_imaginary_node(self) end
child_nodes()
click to toggle source
def child_nodes
: () -> Array[nil | Node]
# File yarp/node.rb, line 5287 def child_nodes [numeric] end
Also aliased as: deconstruct
comment_targets()
click to toggle source
def comment_targets
: () -> Array[Node | Location]
# File yarp/node.rb, line 5292 def comment_targets [numeric] end
copy(**params)
click to toggle source
def copy: (**params) -> ImaginaryNode
# File yarp/node.rb, line 5297 def copy(**params) ImaginaryNode.new( params.fetch(:numeric) { numeric }, params.fetch(:location) { location }, ) end
deconstruct_keys(keys)
click to toggle source
inspect(inspector = NodeInspector.new)
click to toggle source
# File yarp/node.rb, line 5312 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "└── numeric:\n" inspector << inspector.child_node(numeric, " ") inspector.to_str end
value()
click to toggle source
Returns the value of the node as a Ruby Complex.
# File yarp.rb, line 580 def value Complex(0, numeric.value) end