Class: Axiom::Relation::Operation::Reverse
- Inherits:
-
Sorted
- Object
- Axiom::Relation
- Sorted
- Axiom::Relation::Operation::Reverse
- Defined in:
- lib/axiom/relation/operation/reverse.rb
Overview
A class representing a reverse sorted relation
Defined Under Namespace
Modules: Methods
Instance Attribute Summary
Attributes inherited from Sorted
Attributes included from Operation::Unary
Attributes inherited from Axiom::Relation
Class Method Summary collapse
-
.new(operand) ⇒ Reverse
Instantiate a new Reverse relation.
Instance Method Summary collapse
-
#each {|tuple| ... } ⇒ self
Iterate over each tuple in the set.
Methods inherited from Sorted
Methods included from Unary
Methods included from Operation::Unary
Methods inherited from Axiom::Relation
#==, #[], #directions, #empty?, #include?, #initialize, #materialize, #materialized?, #replace
Methods included from Visitable
Constructor Details
This class inherits a constructor from Axiom::Relation::Operation::Sorted
Class Method Details
.new(operand) ⇒ Reverse
Instantiate a new Reverse relation
20 21 22 23 |
# File 'lib/axiom/relation/operation/reverse.rb', line 20 def self.new(operand) assert_sorted_operand(operand) super(operand, operand.directions.reverse) end |
Instance Method Details
#each {|tuple| ... } ⇒ self
Iterate over each tuple in the set
57 58 59 60 61 |
# File 'lib/axiom/relation/operation/reverse.rb', line 57 def each return to_enum unless block_given? operand.reverse_each { |tuple| yield tuple } self end |