Class: YARP::FloatNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::FloatNode
- Defined in:
- lib/yarp/node.rb,
lib/yarp.rb,
ext/yarp/api_node.c
Overview
Represents a floating point number literal.
1.0
^^^
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location].
-
#copy(**params) ⇒ Object
def copy: (**params) -> FloatNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(location) ⇒ FloatNode
constructor
def initialize: (location: Location) -> void.
- #inspect(inspector = NodeInspector.new) ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(location) ⇒ FloatNode
def initialize: (location: Location) -> void
4198 4199 4200 |
# File 'lib/yarp/node.rb', line 4198 def initialize(location) @location = location end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
4203 4204 4205 |
# File 'lib/yarp/node.rb', line 4203 def accept(visitor) visitor.visit_float_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
4208 4209 4210 |
# File 'lib/yarp/node.rb', line 4208 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
4213 4214 4215 |
# File 'lib/yarp/node.rb', line 4213 def comment_targets [] end |
#copy(**params) ⇒ Object
def copy: (**params) -> FloatNode
4218 4219 4220 4221 4222 |
# File 'lib/yarp/node.rb', line 4218 def copy(**params) FloatNode.new( params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
4228 4229 4230 |
# File 'lib/yarp/node.rb', line 4228 def deconstruct_keys(keys) { location: location } end |
#inspect(inspector = NodeInspector.new) ⇒ Object
4232 4233 4234 4235 |
# File 'lib/yarp/node.rb', line 4232 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector.to_str end |
#value ⇒ Object
393 394 395 |
# File 'lib/yarp.rb', line 393 def value Float(slice) end |