Class/Module Index [+]

Quicksearch

Sequel::SQL::OrderedExpression

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

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) click to toggle source

Set the expression and descending attributes to the given values.

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

Public Instance Methods

asc() click to toggle source

Return a copy that is ASC

# File lib/sequel/sql.rb, line 763
def asc
  OrderedExpression.new(@expression, false)
end
desc() click to toggle source

Return a copy that is DESC

# File lib/sequel/sql.rb, line 768
def desc
  OrderedExpression.new(@expression)
end
invert() click to toggle source

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

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.