Class: Alf::Engine::Sort
- Inherits:
-
Object
- Object
- Alf::Engine::Sort
- Includes:
- Cog
- Defined in:
- lib/alf-engine/alf/engine/sort.rb
Overview
Sort its operand according to an ordering information.
Defined Under Namespace
Classes: InMemory
Instance Attribute Summary collapse
-
#operand ⇒ Enumerable
readonly
The operand.
-
#ordering ⇒ Ordering
readonly
The ordering info.
Instance Method Summary collapse
- #_each(&block) ⇒ Object
-
#initialize(operand, ordering) ⇒ Sort
constructor
Creates an Autonum instance.
Methods included from Cog
Constructor Details
#initialize(operand, ordering) ⇒ Sort
Creates an Autonum instance
16 17 18 19 |
# File 'lib/alf-engine/alf/engine/sort.rb', line 16 def initialize(operand, ordering) @operand = operand @ordering = ordering end |
Instance Attribute Details
#operand ⇒ Enumerable (readonly)
Returns The operand.
10 11 12 |
# File 'lib/alf-engine/alf/engine/sort.rb', line 10 def operand @operand end |
#ordering ⇒ Ordering (readonly)
Returns The ordering info.
13 14 15 |
# File 'lib/alf-engine/alf/engine/sort.rb', line 13 def ordering @ordering end |
Instance Method Details
#_each(&block) ⇒ Object
22 23 24 |
# File 'lib/alf-engine/alf/engine/sort.rb', line 22 def _each(&block) Sort::InMemory.new(operand, ordering).each(&block) end |