Sha256: a58b5cee0277c31518be6c42c2a60b7fa2fa19bc6837b94d1ae1957bfb5ee753

Contents?: true

Size: 620 Bytes

Versions: 8

Compression:

Stored size: 620 Bytes

Contents

module Arel
  module Nodes
    class Function < Arel::Nodes::Node
      include Arel::Expression
      include Arel::Predications
      include Arel::WindowPredications
      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

8 entries across 3 versions & 3 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/arel-3.0.3/lib/arel/nodes/function.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/arel-3.0.3/lib/arel/nodes/function.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/lib/arel/nodes/function.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/arel-3.0.3/lib/arel/nodes/function.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/lib/arel/nodes/function.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/lib/arel/nodes/function.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/lib/arel/nodes/function.rb
arel-3.0.3 lib/arel/nodes/function.rb