lib/piglet/field/suffix_expression.rb in piglet-0.2.5 vs lib/piglet/field/suffix_expression.rb in piglet-0.3.0
- old
+ new
@@ -7,17 +7,19 @@
def initialize(operator, expression, options=nil)
options ||= {}
@operator, @expression = operator, expression
@type = options[:type] || expression.type
+ @predecessors = [expression]
end
def simple?
false
end
- def to_s
- "#{parenthesise(@expression)} #{@operator}"
+ def to_s(inner=false)
+ expr = if inner then @expression.field_alias else @expression end
+ "#{parenthesise(expr)} #{@operator}"
end
end
end
end
\ No newline at end of file