soml-parser/lib/ast/if_expression.rb
Torsten Ruger 95fbc3de1a move attributes under contractor
as it is essential that attributes are in the same order for the json
to work
2015-07-11 22:00:11 +03:00

16 lines
408 B
Ruby

module Ast
class IfExpression < Expression
attr_reader :cond, :if_true, :if_false
def initialize cond, if_true, if_false
@cond, @if_true, @if_false = cond, if_true, if_false
end
def attributes
[:cond, :if_true, :if_false]
end
def inspect
self.class.name + ".new(" + cond.inspect + ", "+
if_true.inspect + "," + if_false.inspect + " )"
end
end
end