Class: Arel::Nodes::Ordering

Inherits:
Binary show all
Defined in:
lib/arel/nodes/ordering.rb

Instance Attribute Summary

Attributes inherited from Binary

#left, #right

Instance Method Summary collapse

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

Returns:

  • (Boolean)


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

def ascending?
  direction == :asc
end

#descending?Boolean

Returns:

  • (Boolean)


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

def descending?
  direction == :desc
end