2013-07-28 16:03:06 -07:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2012-11-22 03:00:36 +01:00
|
|
|
module Mutant
|
|
|
|
class Killer
|
2012-12-12 22:31:14 +01:00
|
|
|
# Abstract base class for killer with static result
|
2012-11-22 03:00:36 +01:00
|
|
|
class Static < self
|
2012-12-12 22:31:14 +01:00
|
|
|
|
|
|
|
# Return result
|
|
|
|
#
|
|
|
|
# @return [true]
|
|
|
|
# if mutation was killed
|
|
|
|
#
|
|
|
|
# @return [false]
|
|
|
|
# otherwise
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-11-22 03:00:36 +01:00
|
|
|
def run
|
|
|
|
self.class::RESULT
|
|
|
|
end
|
|
|
|
|
2012-12-12 22:31:14 +01:00
|
|
|
# Killer that is always successful
|
2012-11-22 03:00:36 +01:00
|
|
|
class Success < self
|
|
|
|
RESULT = true
|
2013-06-14 20:54:02 +02:00
|
|
|
end # Success
|
2012-11-22 03:00:36 +01:00
|
|
|
|
2012-12-12 22:31:14 +01:00
|
|
|
# Killer that always fails
|
2012-11-22 03:00:36 +01:00
|
|
|
class Fail < self
|
|
|
|
RESULT = false
|
2013-06-14 20:54:02 +02:00
|
|
|
end # Fail
|
|
|
|
|
|
|
|
end # Static
|
|
|
|
end # Killer
|
|
|
|
end # Mutant
|