Class Index [+]

Quicksearch

Sequel::SQL::OrderedExpression

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

Constants

INVERT_NULLS

Attributes

expression[R]

The expression to order the result set by.

descending[R]

Whether the expression should order the result set in a descending manner

nulls[R]

Whether to sort NULLS FIRST/LAST

Public Class Methods

new(expression, descending = true, opts={}) click to toggle source

Set the expression and descending attributes to the given values. Options:

:nulls

Can be :first/:last for NULLS FIRST/LAST.

      # File lib/sequel/sql.rb, line 1234
1234:       def initialize(expression, descending = true, opts={})
1235:         @expression, @descending, @nulls = expression, descending, opts[:nulls]
1236:       end

Public Instance Methods

asc() click to toggle source

Return a copy that is ordered ASC

      # File lib/sequel/sql.rb, line 1239
1239:       def asc
1240:         OrderedExpression.new(@expression, false, :nulls=>@nulls)
1241:       end
desc() click to toggle source

Return a copy that is ordered DESC

      # File lib/sequel/sql.rb, line 1244
1244:       def desc
1245:         OrderedExpression.new(@expression, true, :nulls=>@nulls)
1246:       end
invert() click to toggle source

Return an inverted expression, changing ASC to DESC and NULLS FIRST to NULLS LAST.

      # File lib/sequel/sql.rb, line 1249
1249:       def invert
1250:         OrderedExpression.new(@expression, !@descending, :nulls=>INVERT_NULLS.fetch(@nulls, @nulls))
1251:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.