Sha256: 33ac60bde2857a74e49ef96a9d989c993a1a61c376f5c14ec9c81d7d8007e84c

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

module Mutant
  class Mutation
    class Filter

      # Whiltelist 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 # Whitelist
    end # Filter
  end # Mutation
end # Mutant

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta20 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta19 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta18 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta17 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta16 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta15 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta14 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta13 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta12 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta11 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta10 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta9 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta8 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta7 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta6 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta5 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta4 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta3 lib/mutant/mutation/filter/whitelist.rb
mutant-0.3.0.beta2 lib/mutant/mutation/filter/whitelist.rb