Class: Alf::Engine::Compact

Inherits:
Object
  • Object
show all
Includes:
Cog
Defined in:
lib/alf/engine/compact.rb

Overview

Remove duplicate tuples from its operand.

Defined Under Namespace

Classes: Set, Uniq

Constant Summary

Constants included from Cog

Alf::Engine::Cog::EMPTY_CHILDREN, Alf::Engine::Cog::EMPTY_OPTIONS

Instance Attribute Summary collapse

Attributes included from Compiler::Cog

#compiler, #expr

Instance Method Summary collapse

Methods included from Cog

#arguments, #children, #each, #options, #to_s

Methods included from Compiler::Cog

#cog_orders, #orderedby?, #relation_type, #to_ascii_tree, #to_cog, #to_relation

Constructor Details

#initialize(operand, expr = nil, compiler = nil) ⇒ Compact

Creates a Compact instance



13
14
15
16
# File 'lib/alf/engine/compact.rb', line 13

def initialize(operand, expr = nil, compiler = nil)
  super(expr, compiler)
  @operand = operand
end

Instance Attribute Details

#operandEnumerable (readonly)

Returns The operand.

Returns:

  • (Enumerable)

    The operand



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

def operand
  @operand
end

Instance Method Details

#_each(&block) ⇒ Object



19
20
21
# File 'lib/alf/engine/compact.rb', line 19

def _each(&block)
  Compact::Uniq.new(operand, expr).each(&block)
end