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