Sha256: 6a189ac676f611afca9c09d11ba185b8fb052bb0c59c019ce8c87417862e63c5

Contents?: true

Size: 438 Bytes

Versions: 20

Compression:

Stored size: 438 Bytes

Contents

# frozen_string_literal: true

module Mutant
  class Matcher
    # Matcher chaining results of other matchers together
    class Chain < self
      include Anima.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

20 entries across 20 versions & 1 rubygems

Version Path
mutant-0.12.4 lib/mutant/matcher/chain.rb
mutant-0.12.3 lib/mutant/matcher/chain.rb
mutant-0.12.2 lib/mutant/matcher/chain.rb
mutant-0.12.0 lib/mutant/matcher/chain.rb
mutant-0.11.34 lib/mutant/matcher/chain.rb
mutant-0.11.33 lib/mutant/matcher/chain.rb
mutant-0.11.32 lib/mutant/matcher/chain.rb
mutant-0.11.31 lib/mutant/matcher/chain.rb
mutant-0.11.30 lib/mutant/matcher/chain.rb
mutant-0.11.29 lib/mutant/matcher/chain.rb
mutant-0.11.28 lib/mutant/matcher/chain.rb
mutant-0.11.27 lib/mutant/matcher/chain.rb
mutant-0.11.26 lib/mutant/matcher/chain.rb
mutant-0.11.25 lib/mutant/matcher/chain.rb
mutant-0.11.24 lib/mutant/matcher/chain.rb
mutant-0.11.23 lib/mutant/matcher/chain.rb
mutant-0.11.22 lib/mutant/matcher/chain.rb
mutant-0.11.21 lib/mutant/matcher/chain.rb
mutant-0.11.20 lib/mutant/matcher/chain.rb
mutant-0.11.19 lib/mutant/matcher/chain.rb