free_mutant/lib/mutant/predicate/blacklist.rb

28 lines
530 B
Ruby
Raw Normal View History

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