Class: Arel::Nodes::Ordering
- Defined in:
- lib/arel/nodes/ordering.rb
Instance Attribute Summary
Attributes inherited from Binary
Instance Method Summary collapse
- #ascending? ⇒ Boolean
- #descending? ⇒ Boolean
-
#initialize(expr, direction = :asc) ⇒ Ordering
constructor
A new instance of Ordering.
Methods inherited from Node
#and, #each, #not, #or, #to_sql
Constructor Details
#initialize(expr, direction = :asc) ⇒ Ordering
Returns a new instance of Ordering.
7 8 9 |
# File 'lib/arel/nodes/ordering.rb', line 7 def initialize expr, direction = :asc super end |
Instance Method Details
#ascending? ⇒ Boolean
11 12 13 |
# File 'lib/arel/nodes/ordering.rb', line 11 def ascending? direction == :asc end |
#descending? ⇒ Boolean
15 16 17 |
# File 'lib/arel/nodes/ordering.rb', line 15 def descending? direction == :desc end |