Sha256: df2f3ca4f75310300c42c035cb15748e02fca1733b48274d5c741ff5fd635615

Contents?: true

Size: 566 Bytes

Versions: 11

Compression:

Stored size: 566 Bytes

Contents

# encoding: utf-8

module Mutant
  class Matcher
    # Matcher filter
    class Filter < self
      include Concord.new(:matcher, :filter)

      # Enumerate matches
      #
      # @return [self]
      #   if block given
      #
      # @return [Enumerator<Subject>]
      #   otherwise
      #
      # @api private
      #
      def each
        return to_enum unless block_given?

        matcher.each do |subject|
          next if filter.match?(subject)
          yield subject
        end

        self
      end

    end # Filter
  end # Matcher
end # Mutant

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mutant-0.3.6 lib/mutant/matcher/filter.rb
mutant-0.3.5 lib/mutant/matcher/filter.rb
mutant-0.3.4 lib/mutant/matcher/filter.rb
mutant-0.3.3 lib/mutant/matcher/filter.rb
mutant-0.3.2 lib/mutant/matcher/filter.rb
mutant-0.3.1 lib/mutant/matcher/filter.rb
mutant-0.3.0 lib/mutant/matcher/filter.rb
mutant-0.3.0.rc5 lib/mutant/matcher/filter.rb
mutant-0.3.0.rc4 lib/mutant/matcher/filter.rb
mutant-0.3.0.rc3 lib/mutant/matcher/filter.rb
mutant-0.3.0.rc2 lib/mutant/matcher/filter.rb