2013-07-28 19:03:06 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2012-11-21 18:10:50 -05:00
|
|
|
module Mutant
|
2013-01-04 16:16:03 -05:00
|
|
|
|
|
|
|
# Abstract base class for killing strategies
|
2013-04-17 23:31:21 -04:00
|
|
|
class Strategy
|
2013-06-15 10:32:40 -04:00
|
|
|
include AbstractType, Adamantium::Flat
|
2012-12-10 18:17:19 -05:00
|
|
|
|
2013-07-17 13:59:44 -04:00
|
|
|
# Perform strategy setup
|
2012-12-10 18:17:19 -05:00
|
|
|
#
|
2013-01-15 17:46:05 -05:00
|
|
|
# @return [self]
|
2012-12-10 18:17:19 -05:00
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2013-07-17 13:59:44 -04:00
|
|
|
def setup
|
2012-12-10 18:17:19 -05:00
|
|
|
end
|
|
|
|
|
2013-07-17 13:59:44 -04:00
|
|
|
# Perform strategy teardown
|
2012-12-10 18:17:19 -05:00
|
|
|
#
|
2013-01-15 17:46:05 -05:00
|
|
|
# @return [self]
|
2012-12-10 18:17:19 -05:00
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2013-07-17 13:59:44 -04:00
|
|
|
def teardown
|
2012-12-10 18:17:19 -05:00
|
|
|
end
|
2012-11-21 18:10:50 -05:00
|
|
|
|
|
|
|
# Kill mutation
|
|
|
|
#
|
2012-12-12 16:31:14 -05:00
|
|
|
# @param [Mutation] mutation
|
2012-11-21 18:10:50 -05:00
|
|
|
#
|
|
|
|
# @return [Killer]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2013-07-17 13:59:44 -04:00
|
|
|
def kill(mutation)
|
2012-11-21 18:10:50 -05:00
|
|
|
killer.new(self, mutation)
|
|
|
|
end
|
|
|
|
|
2013-07-17 13:59:44 -04:00
|
|
|
private
|
|
|
|
|
2012-12-07 10:55:53 -05:00
|
|
|
# Return killer
|
|
|
|
#
|
|
|
|
# @return [Class:Killer]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2013-07-17 13:59:44 -04:00
|
|
|
def killer
|
|
|
|
self.class::KILLER
|
2012-11-21 18:10:50 -05:00
|
|
|
end
|
2013-06-14 14:54:02 -04:00
|
|
|
|
|
|
|
end # Strategy
|
|
|
|
end # Mutant
|