Class: Alf::Engine::Compact::Uniq
- Inherits:
-
Object
- Object
- Alf::Engine::Compact::Uniq
- Includes:
- Alf::Engine::Cog
- Defined in:
- lib/alf-engine/alf/engine/compact/uniq.rb
Overview
Remove duplicate tuples through an in-memory ‘to_a.uniq` heuristics.
Instance Attribute Summary collapse
-
#operand ⇒ Enumerable
readonly
The operand.
Attributes included from Alf::Engine::Cog
Instance Method Summary collapse
- #_each(&block) ⇒ Object
-
#initialize(operand, expr = nil) ⇒ Uniq
constructor
Creates a Compact::Uniq instance.
Methods included from Alf::Engine::Cog
#each, #heading, #keys, #to_cog, #to_dot, #to_relation
Constructor Details
#initialize(operand, expr = nil) ⇒ Uniq
Creates a Compact::Uniq instance
13 14 15 16 |
# File 'lib/alf-engine/alf/engine/compact/uniq.rb', line 13 def initialize(operand, expr = nil) super(expr) @operand = operand end |
Instance Attribute Details
#operand ⇒ Enumerable (readonly)
Returns The operand.
10 11 12 |
# File 'lib/alf-engine/alf/engine/compact/uniq.rb', line 10 def operand @operand end |
Instance Method Details
#_each(&block) ⇒ Object
19 20 21 |
# File 'lib/alf-engine/alf/engine/compact/uniq.rb', line 19 def _each(&block) operand.to_a.uniq.each(&block) end |