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
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/arel-3.0.2/lib/arel/nodes/function.rb
swipe-rails-0.0.5 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
challah-1.0.0.beta3 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
challah-1.0.0.beta2 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
challah-1.0.0.beta vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/nodes/function.rb
challah-0.9.1.beta.3 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
devise_sociable-0.1.0 vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb
challah-0.9.1.beta vendor/bundle/gems/arel-3.0.2/lib/arel/nodes/function.rb