Simplify values
This commit is contained in:
parent
64c3d6070c
commit
202d841be4
1 changed files with 3 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue