Class | Sequel::SQL::OrderedExpression
In: | lib/sequel/sql.rb
Parent: | Expression

Represents a column/expression to order the result set by.

### Methods

asc desc invert new

### Attributes

descending | [R] | Whether the expression should order the result set in a descending manner
expression | [R] | The expression to order the result set by.

### Public Class methods

new(expression, descending = true)

Set the expression and descending attributes to the given values.

[Source]

         # File lib/sequel/sql.rb, line 712
    712:       def initialize(expression, descending = true)
    713:         @expression, @descending = expression, descending
    714:       end

### Public Instance methods

asc()

Return a copy that is ASC

[Source]

         # File lib/sequel/sql.rb, line 717
    717:       def asc
    718:         OrderedExpression.new(@expression, false)
    719:       end

desc()

Return a copy that is DESC

[Source]

         # File lib/sequel/sql.rb, line 722
    722:       def desc
    723:         OrderedExpression.new(@expression)
    724:       end

invert()

Return an inverted expression, changing ASC to DESC and vice versa

[Source]

         # File lib/sequel/sql.rb, line 727
    727:       def invert
    728:         OrderedExpression.new(@expression, !@descending)
    729:       end

[Validate]