Class: Mutant::Strategy

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Adamantium::Flat
Defined in:
lib/mutant/strategy.rb

Overview

Abstract base class for killing strategies

Direct Known Subclasses

Null

Defined Under Namespace

Classes: Null

Constant Summary collapse

REGISTRY =
{}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.lookup(name) ⇒ Strategy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Lookup strategy for name

Parameters:

  • name (String)

Returns:



20
21
22
# File 'lib/mutant/strategy.rb', line 20

def self.lookup(name)
  REGISTRY.fetch(name)
end

Instance Method Details

#kill(mutation) ⇒ Killer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Kill mutation

Parameters:

Returns:



65
66
67
# File 'lib/mutant/strategy.rb', line 65

def kill(mutation)
  killer.new(self, mutation)
end

#setupself

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Perform strategy setup

Returns:

  • (self)


43
44
45
# File 'lib/mutant/strategy.rb', line 43

def setup
  self
end

#teardownself

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Perform strategy teardown

Returns:

  • (self)


53
54
55
# File 'lib/mutant/strategy.rb', line 53

def teardown
  self
end