Sha256: c1fda2ecfca75c5ff0d9169f332e5bb316292a932dc4b2e706c44b25f556ef93

Contents?: true

Size: 965 Bytes

Versions: 7

Compression:

Stored size: 965 Bytes

Contents

module Mutant
  class Mutation
    class Filter
      class Whitelist < self
        include Adamantium::Flat, Equalizer.new(:whitelist)

        # Test for match
        #
        # @param [Mutation] mutation
        #
        # @return [true]
        #   returns true if mutation matches whitelist
        #
        # @return [false]
        #   returns false otherwise
        #
        # @api private
        #
        def match?(mutation)
          @whitelist.any? { |filter| filter.match?(mutation) }
        end

        # Return whitelist
        #
        # @return [Enumerable<Filter>]
        #
        # @api private
        #
        attr_reader :whitelist

      private

        # Initalize white list
        #
        # @param [Enumerable<Filter>] whitelist
        #
        # @return [undefined]
        #
        # @api private
        #
        def initialize(whitelist)
          @whitelist = whitelist
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.2.12 lib/mutant/mutation/filter/whitelist.rb
mutant-0.2.11 lib/mutant/mutation/filter/whitelist.rb
mutant-0.2.9 lib/mutant/mutation/filter/whitelist.rb
mutant-0.2.8 lib/mutant/mutation/filter/whitelist.rb
mutant-0.2.7 lib/mutant/mutation/filter/whitelist.rb
mutant-0.2.6 lib/mutant/mutation/filter/whitelist.rb
mutant-0.2.5 lib/mutant/mutation/filter/whitelist.rb