Class: Mutant::Mutator::Regexp Private
- Inherits:
-
Mutant::Mutator
- Object
- Mutant::Mutator
- Mutant::Mutator::Regexp
- 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.
Direct Known Subclasses
Alternation, GroupCaptureNamed, GroupCapturePositional, Quantifier, Recurse, Replacement
Defined Under Namespace
Classes: Alternation, GroupCaptureNamed, GroupCapturePositional, Quantifier, Recurse, Registry, Replacement
Constant Summary collapse
- REGISTRY =
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.
Registry
Registry.new
Instance Attribute Summary
Attributes inherited from Mutant::Mutator
Class Method Summary collapse
- .mutate(expression) ⇒ Object private
- .regexp_body(node) ⇒ Object private
Methods included from Procto
Class Method Details
.mutate(expression) ⇒ 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.
43 44 45 46 47 48 |
# File 'lib/mutant/mutator/regexp.rb', line 43 def self.mutate(expression) REGISTRY .lookup(expression.class) .map { |mutator| mutator.call(input: expression, parent: nil) } .reduce(&:merge) end |
.regexp_body(node) ⇒ 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.
6 7 8 9 10 11 12 13 |
# File 'lib/mutant/mutator/regexp.rb', line 6 def self.regexp_body(node) *body, = node.children body.map do |child| return unless child.type.equal?(:str) child.children end.join end |