Class: Alf::Engine::Sort

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Cog

#each, #to_dot, #to_relation

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

#operandEnumerable (readonly)

Returns The operand.

Returns:

  • (Enumerable)

    The operand



10
11
12
# File 'lib/alf-engine/alf/engine/sort.rb', line 10

def operand
  @operand
end

#orderingOrdering (readonly)

Returns The ordering info.

Returns:

  • (Ordering)

    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