Sha256: 725c60dee8836f6ae6c97fbef391aab8079e0c953801b80dff73bb0b81ecf431

Contents?: true

Size: 581 Bytes

Versions: 108

Compression:

Stored size: 581 Bytes

Contents

module Arel
  module Nodes
    class Function < Arel::Nodes::Node
      include Arel::Expression
      include Arel::Predications
      attr_accessor :expressions, :alias, :distinct

      def initialize expr, aliaz = nil
        @expressions = expr
        @alias       = aliaz && SqlLiteral.new(aliaz)
        @distinct    = false
      end

      def as aliaz
        self.alias = SqlLiteral.new(aliaz)
        self
      end
    end

    %w{
      Sum
      Exists
      Max
      Min
      Avg
    }.each do |name|
      const_set(name, Class.new(Function))
    end
  end
end

Version data entries

108 entries across 95 versions & 12 rubygems

Version Path
dirty_history-0.4.3 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb
dirty_history-0.4.2 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb
dirty_history-0.3.0 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb
arel-2.2.1 lib/arel/nodes/function.rb
arel-2.2.0 lib/arel/nodes/function.rb
arel-2.1.4 lib/arel/nodes/function.rb
arel-2.1.3 lib/arel/nodes/function.rb
arel-2.1.2 lib/arel/nodes/function.rb