free_mutant/lib/mutant/strategy.rb

55 lines
750 B
Ruby
Raw Normal View History

# encoding: utf-8
2012-11-22 00:10:50 +01:00
module Mutant
# Abstract base class for killing strategies
2013-04-17 20:31:21 -07:00
class Strategy
include AbstractType, Adamantium::Flat
# Perform strategy setup
#
2013-01-15 23:46:05 +01:00
# @return [self]
#
# @api private
#
def setup
2013-09-02 22:02:51 +02:00
self
end
# Perform strategy teardown
#
2013-01-15 23:46:05 +01:00
# @return [self]
#
# @api private
#
def teardown
2013-09-02 22:02:51 +02:00
self
end
2012-11-22 00:10:50 +01:00
# Kill mutation
#
# @param [Mutation] mutation
2012-11-22 00:10:50 +01:00
#
# @return [Killer]
#
# @api private
#
def kill(mutation)
2012-11-22 00:10:50 +01:00
killer.new(self, mutation)
end
private
# Return killer
#
# @return [Class:Killer]
#
# @api private
#
def killer
self.class::KILLER
2012-11-22 00:10:50 +01:00
end
2013-06-14 20:54:02 +02:00
end # Strategy
end # Mutant