Class: Foxtail::Bundle::Parser::AST::NumberLiteral
- Inherits:
-
Data
- Object
- Data
- Foxtail::Bundle::Parser::AST::NumberLiteral
- Defined in:
- lib/foxtail/bundle/parser/ast.rb,
lib/foxtail/bundle/parser/ast.rb
Overview
Number literal expression in Fluent patterns
Instance Attribute Summary collapse
-
#precision ⇒ Object
readonly
- Integer
-
Number of decimal places.
-
#value ⇒ Object
readonly
- Float
-
The numeric value.
Instance Method Summary collapse
-
#initialize(value:, precision: 0) ⇒ NumberLiteral
constructor
A new instance of NumberLiteral.
Constructor Details
#initialize(value:, precision: 0) ⇒ NumberLiteral
Returns a new instance of NumberLiteral.
26 |
# File 'lib/foxtail/bundle/parser/ast.rb', line 26 def initialize(value:, precision: 0) = super(value: Float(value), precision: Integer(precision)) |
Instance Attribute Details
#precision ⇒ Object (readonly)
- Integer
-
Number of decimal places
23 24 25 |
# File 'lib/foxtail/bundle/parser/ast.rb', line 23 def precision @precision end |
#value ⇒ Object (readonly)
- Float
-
The numeric value
23 24 25 |
# File 'lib/foxtail/bundle/parser/ast.rb', line 23 def value @value end |