Class: Romanesco::ConstantOperand

Inherits:
Operand show all
Defined in:
lib/romanesco/elements/constant_operand.rb

Instance Attribute Summary collapse

Attributes inherited from Expression

#parent

Instance Method Summary collapse

Methods inherited from Operand

#connect

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

#valueObject

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(options)
  @value
end

#to_sObject



16
17
18
# File 'lib/romanesco/elements/constant_operand.rb', line 16

def to_s
  @value.to_s
end