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 end
class TreeValue class TreeValue
attr_accessor :value def value
raise "No value for #{@name}" if @value.nil?
end
end end
class VarValue < TreeValue class VarValue < TreeValue
attr_accessor :value
def initialize str def initialize str
@name = str @name = str
@value = nil @value = nil
end end
def compute
# FIXME: test if @value is a boolean
# raise an exception in all other cases
@value
end
end end
class NumberValue < TreeValue class NumberValue < TreeValue