Module: Arel::Expressions

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

Instance Method Summary collapse

Instance Method Details

#averageObject



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

def average
  Nodes::Avg.new [self]
end

#count(distinct = false) ⇒ Object



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

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

#extract(field) ⇒ Object



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

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

#maximumObject



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

def maximum
  Nodes::Max.new [self]
end

#minimumObject



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

def minimum
  Nodes::Min.new [self]
end

#sumObject



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

def sum
  Nodes::Sum.new [self]
end