Class: Kalc::Ast::FloatingPointNumber
- Inherits:
-
Object
- Object
- Kalc::Ast::FloatingPointNumber
- Defined in:
- lib/kalc/ast.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #eval(context) ⇒ Object
-
#initialize(value) ⇒ FloatingPointNumber
constructor
A new instance of FloatingPointNumber.
Constructor Details
#initialize(value) ⇒ FloatingPointNumber
Returns a new instance of FloatingPointNumber.
84 85 86 |
# File 'lib/kalc/ast.rb', line 84 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
82 83 84 |
# File 'lib/kalc/ast.rb', line 82 def value @value end |
Instance Method Details
#eval(context) ⇒ Object
88 89 90 |
# File 'lib/kalc/ast.rb', line 88 def eval(context) Float(@value) end |