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
challah-0.7.0.pre2 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
dirty_history-0.6.3 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb
challah-0.7.0.pre vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
challah-0.6.2 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
dirty_history-0.6.2 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb
dirty_history-0.6.1 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb
initforthe-cookies-0.0.1 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
dirty_history-0.6.0 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb
challah-0.6.1 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
challah-0.6.1 vendor/bundle/gems/arel-3.0.0/lib/arel/nodes/function.rb
dirty_history-0.5.4 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/nodes/function.rb