free_mutant/lib/mutant/matcher/null.rb
2015-07-02 03:35:54 +00:00

23 lines
440 B
Ruby

module Mutant
class Matcher
# A null matcher, that does not match any subjects
class Null < self
include Concord.new
# Enumerate subjects
#
# @return [Enumerator<Subject]
# if no block given
#
# @return [self]
# otherwise
#
# @api private
def each
return to_enum unless block_given?
self
end
end # Null
end # Matcher
end # Mutant