Sha256: 0ad4aec4e31c40b5ea771b4b82e1b9132f728d4ae4379107bd750168e77dc788

Contents?: true

Size: 488 Bytes

Versions: 5

Compression:

Stored size: 488 Bytes

Contents

module Alf
  module Engine
    #
    # Remove duplicate tuples through an in-memory `to_a.uniq` heuristics.
    #
    class Compact::Uniq < Cog

      # @return [Enumerable] The operand
      attr_reader :operand

      # Creates a Compact::Uniq instance
      def initialize(operand)
        @operand = operand
      end

      # (see Cog#each)
      def each(&block)
        operand.to_a.uniq.each(&block)
      end

    end # class Compact::Uniq
  end # module Engine
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-0.12.2 lib/alf-engine/alf/engine/compact/uniq.rb
alf-0.12.1 lib/alf-engine/alf/engine/compact/uniq.rb
alf-0.12.0 lib/alf-engine/alf/engine/compact/uniq.rb
alf-0.11.1 lib/alf-engine/alf/engine/compact/uniq.rb
alf-0.11.0 lib/alf-engine/alf/engine/compact/uniq.rb