Module: Arel::Expressions

Included in:
Attributes::Attribute, Nodes::InfixOperation, Nodes::SqlLiteral
Defined in:
lib/arel/expressions.rb

Instance Method Summary collapse

Instance Method Details

#averageObject


19
20
21
# File 'lib/arel/expressions.rb', line 19

def average
  Nodes::Avg.new [self], Nodes::SqlLiteral.new('avg_id')
end

#count(distinct = false) ⇒ Object


3
4
5
# File 'lib/arel/expressions.rb', line 3

def count distinct = false
  Nodes::Count.new [self], distinct
end

#extract(field) ⇒ Object


23
24
25
# File 'lib/arel/expressions.rb', line 23

def extract field
  Nodes::Extract.new [self], field
end

#maximumObject


11
12
13
# File 'lib/arel/expressions.rb', line 11

def maximum
  Nodes::Max.new [self], Nodes::SqlLiteral.new('max_id')
end

#minimumObject


15
16
17
# File 'lib/arel/expressions.rb', line 15

def minimum
  Nodes::Min.new [self], Nodes::SqlLiteral.new('min_id')
end

#sumObject


7
8
9
# File 'lib/arel/expressions.rb', line 7

def sum
  Nodes::Sum.new [self], Nodes::SqlLiteral.new('sum_id')
end