aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes/ordering.rb
blob: 0a3621cf5434ca032e43cf533892efe7e68bb442 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Arel
  module Nodes
    class Ordering < Arel::Nodes::Binary
      alias :expr :left
      alias :direction :right

      def initialize expr, direction = :asc
        super
      end

      def ascending?
        direction == :asc
      end

      def descending?
        direction == :desc
      end
    end
  end
end