Module: Arel::Expressions
- Included in:
- Attributes::Attribute, Nodes::SqlLiteral
- Defined in:
- lib/arel/expressions.rb
Instance Method Summary collapse
- #average ⇒ Object
- #count(distinct = false) ⇒ Object
- #maximum ⇒ Object
- #minimum ⇒ Object
- #sum ⇒ Object
Instance Method Details
#average ⇒ Object
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 |
#maximum ⇒ Object
11 12 13 |
# File 'lib/arel/expressions.rb', line 11 def maximum Nodes::Max.new [self], Nodes::SqlLiteral.new('max_id') end |
#minimum ⇒ Object
15 16 17 |
# File 'lib/arel/expressions.rb', line 15 def minimum Nodes::Min.new [self], Nodes::SqlLiteral.new('min_id') end |
#sum ⇒ Object
7 8 9 |
# File 'lib/arel/expressions.rb', line 7 def sum Nodes::Sum.new [self], Nodes::SqlLiteral.new('sum_id') end |