Class: Mutant::Mutator::Regexp::Quantifier Private
- Inherits:
-
Mutant::Mutator::Regexp
- Object
- Mutant::Mutator
- Mutant::Mutator::Regexp
- Mutant::Mutator::Regexp::Quantifier
- Defined in:
- lib/mutant/mutator/regexp.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- MAP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ '*' => '+', '*+' => '++', '*?' => '+?' }.freeze
Constants inherited from Mutant::Mutator::Regexp
Instance Attribute Summary
Attributes inherited from Mutant::Mutator
Instance Method Summary collapse
- #dispatch ⇒ Object private
- #emit_removal ⇒ Object private
- #emit_replacement ⇒ Object private
Methods inherited from Mutant::Mutator::Regexp
Methods included from Procto
Instance Method Details
#dispatch ⇒ Object
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.
94 95 96 97 98 99 |
# File 'lib/mutant/mutator/regexp.rb', line 94 def dispatch return unless input.quantifier emit_removal emit_replacement end |
#emit_removal ⇒ Object
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.
101 102 103 |
# File 'lib/mutant/mutator/regexp.rb', line 101 def emit_removal emit(mk_dup.tap { |new| new.quantifier = nil }) end |
#emit_replacement ⇒ Object
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.
105 106 107 108 109 |
# File 'lib/mutant/mutator/regexp.rb', line 105 def emit_replacement new_text = MAP[input.quantifier.text] or return emit(mk_dup.tap { |new| new.quantifier.text = new_text }) end |