Class: Axiom::Relation::Operation::Sorted::Ascending
- Defined in:
- lib/axiom/relation/operation/sorted/direction.rb
Overview
Represent an attribute sorted ascending
Instance Attribute Summary
Attributes inherited from Direction
Class Method Summary collapse
-
.call(left, right) ⇒ -1, ...
private
Compare the left and right value.
-
.reverse ⇒ Class<Descending>
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
141 142 143 |
# File 'lib/axiom/relation/operation/sorted/direction.rb', line 141 def self.call(left, right) left <=> right || (1 if left.nil?) || (-1 if right.nil?) end |
.reverse ⇒ Class<Descending>
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
122 123 124 |
# File 'lib/axiom/relation/operation/sorted/direction.rb', line 122 def self.reverse Descending end |