Module: Arel::Expressions

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

Instance Method Summary collapse

Instance Method Details

#averageObject



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

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

#count(distinct = false) ⇒ Object



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

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

#extract(field) ⇒ Object



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

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

#maximumObject



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

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

#minimumObject



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

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

#sumObject



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

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