Module: Axiom::Attribute::Comparable

Overview

A mixin for attributes that have comparable objects

Instance Method Summary collapse

Methods included from Function::Predicate::GreaterThan::Methods

#gt

Methods included from Function::Predicate::GreaterThanOrEqualTo::Methods

#gte

Methods included from Function::Predicate::LessThan::Methods

#lt

Methods included from Function::Predicate::LessThanOrEqualTo::Methods

#lte

Instance Method Details

#ascAxiom::Relation::Operation::Sorted::Ascending

Sort the attribute in ascending order

Examples:

ascending = attribute.asc

Returns:



21
22
23
# File 'lib/axiom/attribute/comparable.rb', line 21

def asc
  Axiom::Relation::Operation::Sorted::Ascending.new(self)
end

#descAxiom::Relation::Operation::Sorted::Descending

Sort the attribute in descending order

Examples:

descending = attribute.desc

Returns:



33
34
35
# File 'lib/axiom/attribute/comparable.rb', line 33

def desc
  Axiom::Relation::Operation::Sorted::Descending.new(self)
end

#rangeRange

The range for the objects

Returns:



42
43
44
# File 'lib/axiom/attribute/comparable.rb', line 42

def range
  type.range
end