Class: Mutant::Mutation::Filter

Inherits:
Object
  • Object
show all
Extended by:
DescendantsTracker
Includes:
AbstractType, Adamantium::Flat
Defined in:
lib/mutant/mutation/filter.rb,
lib/mutant/mutation/filter/code.rb,
lib/mutant/mutation/filter/regexp.rb,
lib/mutant/mutation/filter/whitelist.rb

Overview

Abstract filter for mutations

Direct Known Subclasses

Code, Regexp, Whitelist

Defined Under Namespace

Classes: Code, Regexp, Whitelist

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(notation) ⇒ Filter?

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.

Build filter from string

Parameters:

  • notation (String)

Returns:

  • (Filter)

    returns filter when can be buld from string

  • (nil)

    returns nil otherwise



34
35
36
37
38
39
40
41
# File 'lib/mutant/mutation/filter.rb', line 34

def self.build(notation)
  descendants.each do |descendant| 
    filter = descendant.handle(notation)
    return filter if filter
  end

  nil
end

.handle(notation) ⇒ nil

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.

Return filter for handle

Parameters:

  • notation (String)

Returns:

  • (nil)

    returns nil



52
53
54
# File 'lib/mutant/mutation/filter.rb', line 52

def self.handle(notation)
  nil
end

Instance Method Details

#match?true, false

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.

Check for match

Parameters:

Returns:

  • (true)

    returns true if mutation is matched by filter

  • (false)

    returns false otherwise



20
# File 'lib/mutant/mutation/filter.rb', line 20

abstract_method :match?