Simplify values

This commit is contained in:
Glenn Y. Rolland 2017-09-12 16:19:51 +02:00
parent 64c3d6070c
commit 202d841be4

View file

@ -7,22 +7,16 @@ module Mm2ep
end
class TreeValue
attr_accessor :value
def value
raise "No value for #{@name}" if @value.nil?
end
end
class VarValue < TreeValue
attr_accessor :value
def initialize str
@name = str
@value = nil
end
def compute
# FIXME: test if @value is a boolean
# raise an exception in all other cases
@value
end
end
class NumberValue < TreeValue