2013-09-07 18:57:06 +02:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
module Mutant
|
2013-09-07 23:12:03 +02:00
|
|
|
class Predicate
|
2013-09-13 22:28:04 +02:00
|
|
|
|
2013-09-07 18:57:06 +02:00
|
|
|
# Whiltelist filter
|
|
|
|
class Whitelist < self
|
|
|
|
include Adamantium::Flat, Concord.new(:whitelist)
|
|
|
|
|
|
|
|
# Test for match
|
|
|
|
#
|
|
|
|
# @param [Object] object
|
|
|
|
#
|
|
|
|
# @return [true]
|
|
|
|
# if mutation matches whitelist
|
|
|
|
#
|
|
|
|
# @return [false]
|
|
|
|
# otherwise
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def match?(object)
|
|
|
|
whitelist.any? { |filter| filter.match?(object) }
|
|
|
|
end
|
|
|
|
|
|
|
|
end # Whitelist
|
2013-09-07 23:12:03 +02:00
|
|
|
end # Predicate
|
2013-09-07 18:57:06 +02:00
|
|
|
end # Mutant
|