2012-11-22 00:10:50 +01:00
|
|
|
module Mutant
|
|
|
|
class Strategy
|
2012-11-26 11:30:00 +01:00
|
|
|
include AbstractType
|
2012-11-22 00:10:50 +01:00
|
|
|
|
|
|
|
# Kill mutation
|
|
|
|
#
|
|
|
|
# @param [Mutation]
|
|
|
|
#
|
|
|
|
# @return [Killer]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def self.kill(mutation)
|
|
|
|
killer.new(self, mutation)
|
|
|
|
end
|
|
|
|
|
2012-12-07 16:55:53 +01:00
|
|
|
# Return killer
|
|
|
|
#
|
|
|
|
# @return [Class:Killer]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-11-22 00:10:50 +01:00
|
|
|
def self.killer
|
2012-11-22 02:08:42 +01:00
|
|
|
self::KILLER
|
2012-11-22 00:10:50 +01:00
|
|
|
end
|
|
|
|
|
2012-12-07 16:55:53 +01:00
|
|
|
# Static strategies
|
2012-11-22 03:00:36 +01:00
|
|
|
class Static < self
|
2012-12-07 16:55:53 +01:00
|
|
|
|
|
|
|
# Always fail to kill strategy
|
2012-11-22 03:00:36 +01:00
|
|
|
class Fail < self
|
|
|
|
KILLER = Killer::Static::Fail
|
|
|
|
end
|
|
|
|
|
2012-12-07 16:55:53 +01:00
|
|
|
# Always succeed to kill strategy
|
2012-11-22 03:00:36 +01:00
|
|
|
class Success < self
|
|
|
|
KILLER = Killer::Static::Success
|
|
|
|
end
|
2012-11-22 00:10:50 +01:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|