Module: Arel::Expressions

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) average



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

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

- (Object) count(distinct = false)



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

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

- (Object) extract(field)



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

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

- (Object) maximum



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

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

- (Object) minimum



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

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

- (Object) sum



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

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