2012-07-23 16:54:35 -04:00
|
|
|
module Mutant
|
2013-01-21 14:08:30 -05:00
|
|
|
# Abstract matcher to find subjects to mutate
|
2012-07-23 16:54:35 -04:00
|
|
|
class Matcher
|
2012-11-26 05:30:00 -05:00
|
|
|
include Adamantium::Flat, Enumerable, AbstractType
|
2012-08-28 13:54:28 -04:00
|
|
|
extend DescendantsTracker
|
2012-07-23 16:54:35 -04:00
|
|
|
|
2013-01-21 16:56:52 -05:00
|
|
|
# Enumerate subjects
|
|
|
|
#
|
|
|
|
# @param [Object] input
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
# if block given
|
|
|
|
#
|
|
|
|
# @return [Enumerator<Subject>]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def self.each(input, &block)
|
|
|
|
return to_enum(__method__, input) unless block_given?
|
|
|
|
|
|
|
|
new(input).each(&block)
|
|
|
|
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2012-08-01 12:34:03 -04:00
|
|
|
# Enumerate subjects
|
2012-07-23 16:54:35 -04:00
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2013-01-21 14:08:30 -05:00
|
|
|
# @return [self]
|
|
|
|
# if block given
|
|
|
|
#
|
|
|
|
# @return [Enumerabe<Subject>]
|
|
|
|
# otherwise
|
2012-07-23 19:41:08 -04:00
|
|
|
#
|
2012-08-02 19:28:15 -04:00
|
|
|
abstract_method :each
|
2012-07-26 13:25:23 -04:00
|
|
|
|
2012-08-15 22:10:54 -04:00
|
|
|
# Return identification
|
|
|
|
#
|
|
|
|
# @return [String
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
abstract_method :identification
|
2013-06-14 14:54:02 -04:00
|
|
|
|
|
|
|
end # Matcher
|
|
|
|
end # Mutant
|