class Axiom::Relation::Operation::Sorted::Descending

Represent an attribute sorted descending

Public Class Methods

call(left, right) click to toggle source

Compare the left and right value

@param [Comparable] left @param [Comparable] right

@return [-1]

returned if the left should be sorted after the right

@return [0]

returned if the right and left are equal

@return [1]

returned if the left should be sorted before the right

@api private

# File lib/axiom/relation/operation/sorted/direction.rb, line 174
def self.call(left, right)
  right <=> left || (1 if right.nil?) || (-1 if left.nil?)
end
reverse() click to toggle source

Return the reversed direction class

@return [Class<Ascending>]

@api private

# File lib/axiom/relation/operation/sorted/direction.rb, line 155
def self.reverse
  Ascending
end