rename conditional to if expression

This commit is contained in:
Torsten Ruger
2014-05-24 10:18:54 +03:00
parent 6eeefc5617
commit 00d85156da
6 changed files with 27 additions and 5 deletions

15
lib/ast/if_expression.rb Normal file
View File

@ -0,0 +1,15 @@
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 inspect
self.class.name + ".new(" + cond.inspect + ", "+
if_true.inspect + "," + if_false.inspect + " )"
end
def attributes
[:cond, :if_true, :if_false]
end
end
end