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.
Attributes included from Cog
Instance Method Summary collapse
- #_each(&block) ⇒ Object
-
#initialize(operand, ordering, expr = nil) ⇒ Sort
constructor
Creates an Autonum instance.
Methods included from Cog
#each, #heading, #keys, #to_cog, #to_dot, #to_relation
Constructor Details
#initialize(operand, ordering, expr = nil) ⇒ Sort
Creates an Autonum instance
16 17 18 19 20 |
# File 'lib/alf-engine/alf/engine/sort.rb', line 16 def initialize(operand, ordering, expr = nil) super(expr) @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
23 24 25 |
# File 'lib/alf-engine/alf/engine/sort.rb', line 23 def _each(&block) Sort::InMemory.new(operand, ordering, expr).each(&block) end |