Sha256: 34f183e2764fbc34f5d3438958856e02c0a6cb40aa827972a75551443e5bd6a1

Contents?: true

Size: 512 Bytes

Versions: 7

Compression:

Stored size: 512 Bytes

Contents

module Mutant
  class Matcher
    # A chain of matchers
    class Chain < self
      include Concord.new(:matchers)

      # Enumerate subjects
      #
      # @return [Enumerator<Subject]
      #   if no block given
      #
      # @return [self]
      #   otherwise
      #
      # @api private
      def each(&block)
        return to_enum unless block_given?

        matchers.each do |matcher|
          matcher.each(&block)
        end

        self
      end

    end # Chain
  end # Matcher
end # Mutant

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.8.7 lib/mutant/matcher/chain.rb
mutant-0.8.6 lib/mutant/matcher/chain.rb
mutant-0.8.5 lib/mutant/matcher/chain.rb
mutant-0.8.4 lib/mutant/matcher/chain.rb
mutant-0.8.3 lib/mutant/matcher/chain.rb
mutant-0.8.2 lib/mutant/matcher/chain.rb
mutant-0.8.1 lib/mutant/matcher/chain.rb