lib/piglet/field/binary_conditional.rb in piglet-0.1.2 vs lib/piglet/field/binary_conditional.rb in piglet-0.2.0
- old
+ new
@@ -1,13 +1,14 @@
module Piglet
module Field
- include Operators
-
class BinaryConditional
+ include Field
+
def initialize(test, if_true, if_false)
@test, @if_true, @if_false = test, if_true, if_false
+ @type = expression_type(@if_true)
end
-
+
def to_s
"(#{@test} ? #{@if_true} : #{@if_false})"
end
end
end
\ No newline at end of file