Class: ExpressionInterpreter::Constant
- Inherits:
-
Object
- Object
- ExpressionInterpreter::Constant
- Defined in:
- lib/expression_interpreter.rb
Instance Method Summary collapse
- #evaluate(context) ⇒ Object
-
#initialize(value) ⇒ Constant
constructor
A new instance of Constant.
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ Constant
Returns a new instance of Constant.
98 99 100 |
# File 'lib/expression_interpreter.rb', line 98 def initialize(value) @value = value.to_f end |
Instance Method Details
#evaluate(context) ⇒ Object
101 102 103 |
# File 'lib/expression_interpreter.rb', line 101 def evaluate(context) @value end |
#to_s ⇒ Object
104 105 106 |
# File 'lib/expression_interpreter.rb', line 104 def to_s @value.to_s end |