Class Index [+]

Quicksearch

DataMapper::Query::Sort

Attributes

value[R]

@api semipublic

Public Class Methods

new(value, ascending = true) click to toggle source

@api private

    # File lib/dm-core/query/sort.rb, line 33
33:       def initialize(value, ascending = true)
34:         @value     = value
35:         @ascending = ascending
36:       end

Public Instance Methods

<=>(other) click to toggle source

@api private

    # File lib/dm-core/query/sort.rb, line 15
15:       def <=>(other)
16:         other_value = other.value
17:         value_nil   = @value.nil?
18:         other_nil   = other_value.nil?
19: 
20:         cmp = case
21:           when value_nil then other_nil ? 0 : 1
22:           when other_nil then 1
23:           else
24:             @value <=> other_value
25:         end
26: 
27:         @ascending ? cmp : cmp * 1
28:       end
direction() click to toggle source

@api semipublic

    # File lib/dm-core/query/sort.rb, line 10
10:       def direction
11:         @ascending ? :ascending : :descending
12:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.