Class: Mutant::Mutation::Filter::Code
- Inherits:
-
Mutant::Mutation::Filter
- Object
- Mutant::Mutation::Filter
- Mutant::Mutation::Filter::Code
- Defined in:
- lib/mutant/mutation/filter/code.rb
Overview
Mutation filter that filters on mutation codes
Constant Summary collapse
- PATTERN =
%r(\Acode:([a-f0-9]{1,6})\z).freeze
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
private
Return code.
Class Method Summary collapse
-
.handle(notation) ⇒ Filter?
private
Test if class handles string.
Instance Method Summary collapse
-
#match?(mutation) ⇒ true, false
private
Test for match.
Methods inherited from Mutant::Mutation::Filter
Instance Attribute Details
#code ⇒ String (readonly)
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 code
50 51 52 |
# File 'lib/mutant/mutation/filter/code.rb', line 50 def code @code end |
Class Method Details
.handle(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.
Test if class handles string
38 39 40 41 42 |
# File 'lib/mutant/mutation/filter/code.rb', line 38 def self.handle(notation) match = PATTERN.match(notation) return unless match new(match[1]) end |
Instance Method Details
#match?(mutation) ⇒ 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.
Test for match
20 21 22 |
# File 'lib/mutant/mutation/filter/code.rb', line 20 def match?(mutation) mutation.code.eql?(code) end |