Sha256: 23159a6ddf0e2d83c27e3568b5929f6d947cf11c84a4273de3219e9ffc0d4008

Contents?: true

Size: 440 Bytes

Versions: 17

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

module Mutant
  class Matcher
    # Matcher chaining results of other matchers together
    class Chain < self
      include Concord.new(:matchers)

      # Call matcher
      #
      # @param [Env] env
      #
      # @return [Enumerable<Subject>]
      def call(env)
        matchers.flat_map do |matcher|
          matcher.call(env)
        end.uniq
      end

    end # Chain
  end # Matcher
end # Mutant

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mutant-0.11.18 lib/mutant/matcher/chain.rb
mutant-0.11.17 lib/mutant/matcher/chain.rb
mutant-0.11.16 lib/mutant/matcher/chain.rb
mutant-0.11.15 lib/mutant/matcher/chain.rb
mutant-0.11.14 lib/mutant/matcher/chain.rb
mutant-0.11.13 lib/mutant/matcher/chain.rb
mutant-0.11.12 lib/mutant/matcher/chain.rb
mutant-0.11.11 lib/mutant/matcher/chain.rb
mutant-0.11.10 lib/mutant/matcher/chain.rb
mutant-0.11.9 lib/mutant/matcher/chain.rb
mutant-0.11.8 lib/mutant/matcher/chain.rb
mutant-0.11.7 lib/mutant/matcher/chain.rb
mutant-0.11.6 lib/mutant/matcher/chain.rb
mutant-0.11.5 lib/mutant/matcher/chain.rb
mutant-0.11.4 lib/mutant/matcher/chain.rb
mutant-0.11.3 lib/mutant/matcher/chain.rb
mutant-0.11.2 lib/mutant/matcher/chain.rb