lib/piglet/field/call_expression.rb in piglet-0.1.2 vs lib/piglet/field/call_expression.rb in piglet-0.2.0

- old
+ new

@@ -1,21 +1,21 @@ module Piglet module Field class CallExpression # :nodoc: - include Operators + include Field - def initialize(name, inner_expression, options=nil) + def initialize(function_name, inner_expression, options=nil) options ||= {} - @name, @inner_expression = name, inner_expression - @new_name = options[:as] + @function_name, @inner_expression = function_name, inner_expression + @type = options[:type] || inner_expression.type end - + def simple? false end def to_s - "#{@name}(#{@inner_expression})" + "#{@function_name}(#{@inner_expression})" end end end end \ No newline at end of file