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