Class: Romanesco::ConstantOperand
- Inherits:
-
Operand
- Object
- Expression
- Operand
- Romanesco::ConstantOperand
- Defined in:
- lib/romanesco/elements/constant_operand.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Expression
Instance Method Summary collapse
- #evaluate(options) ⇒ Object
-
#initialize(value) ⇒ ConstantOperand
constructor
A new instance of ConstantOperand.
- #to_s ⇒ Object
Methods inherited from Operand
Constructor Details
#initialize(value) ⇒ ConstantOperand
Returns a new instance of ConstantOperand.
8 9 10 |
# File 'lib/romanesco/elements/constant_operand.rb', line 8 def initialize(value) @value = value.to_f end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/romanesco/elements/constant_operand.rb', line 6 def value @value end |
Instance Method Details
#evaluate(options) ⇒ Object
12 13 14 |
# File 'lib/romanesco/elements/constant_operand.rb', line 12 def evaluate() @value end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/romanesco/elements/constant_operand.rb', line 16 def to_s @value.to_s end |