Class: Arel::Ordering
- Inherits:
-
Object
- Object
- Arel::Ordering
- Defined in:
- lib/arel/algebra/ordering.rb,
lib/arel/engines/sql/primitives.rb,
lib/arel/engines/memory/primitives.rb
Direct Known Subclasses
Instance Method Summary collapse
- #bind(relation) ⇒ Object
- #eval(row1, row2) ⇒ Object
- #to_ordering ⇒ Object
- #to_sql(formatter = Sql::OrderClause.new(relation)) ⇒ Object
Instance Method Details
#bind(relation) ⇒ Object
5 6 7 |
# File 'lib/arel/algebra/ordering.rb', line 5 def bind(relation) self.class.new(attribute.bind(relation)) end |
#eval(row1, row2) ⇒ Object
15 16 17 |
# File 'lib/arel/engines/memory/primitives.rb', line 15 def eval(row1, row2) (attribute.eval(row1) <=> attribute.eval(row2)) * direction end |
#to_ordering ⇒ Object
9 10 11 |
# File 'lib/arel/algebra/ordering.rb', line 9 def to_ordering self end |
#to_sql(formatter = Sql::OrderClause.new(relation)) ⇒ Object
55 56 57 |
# File 'lib/arel/engines/sql/primitives.rb', line 55 def to_sql(formatter = Sql::OrderClause.new(relation)) formatter.ordering self end |