Class: Axiom::Relation::Operation::Sorted::Descending
- Defined in:
- lib/axiom/relation/operation/sorted/direction.rb
Overview
Represent an attribute sorted descending
Instance Attribute Summary
Attributes inherited from Direction
Class Method Summary collapse
-
.call(left, right) ⇒ -1, ...
private
Compare the left and right value.
-
.reverse ⇒ Class<Ascending>
private
Return the reversed direction class.
Methods inherited from Direction
#call, coerce, #initialize, #name, #rename, #reverse
Methods included from Aliasable
Constructor Details
This class inherits a constructor from Axiom::Relation::Operation::Sorted::Direction
Class Method Details
.call(left, right) ⇒ -1, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Compare the left and right value
174 175 176 |
# 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 ⇒ Class<Ascending>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the reversed direction class
155 156 157 |
# File 'lib/axiom/relation/operation/sorted/direction.rb', line 155 def self.reverse Ascending end |