Class: Mutant::Matcher Private
- Inherits:
-
Object
- Object
- Mutant::Matcher
- Includes:
- Unparser::AbstractType, Unparser::Adamantium
- Defined in:
- lib/mutant/matcher.rb,
lib/mutant/matcher/null.rb,
lib/mutant/matcher/chain.rb,
lib/mutant/matcher/scope.rb,
lib/mutant/matcher/config.rb,
lib/mutant/matcher/filter.rb,
lib/mutant/matcher/method.rb,
lib/mutant/matcher/static.rb,
lib/mutant/matcher/methods.rb,
lib/mutant/matcher/namespace.rb,
lib/mutant/matcher/descendants.rb,
lib/mutant/matcher/method/instance.rb,
lib/mutant/matcher/method/metaclass.rb,
lib/mutant/matcher/method/singleton.rb
Overview
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.
Abstract matcher to find subjects to mutate
Defined Under Namespace
Classes: Chain, Config, Descendants, Filter, Method, Methods, Namespace, Null, Scope, Static
Class Method Summary collapse
-
.from_config(config) ⇒ Matcher
private
Turn config into matcher.
-
.ignore_subject?(config, subject) ⇒ Boolean
private
Predicate that tests for ignored subject.
Instance Method Summary collapse
-
#call ⇒ Enumerable<Subject>
private
Call matcher.
Class Method Details
.from_config(config) ⇒ Matcher
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.
Turn config into matcher
21 22 23 24 25 26 |
# File 'lib/mutant/matcher.rb', line 21 def self.from_config(config) Filter.new( matcher: Chain.new(matchers: config.subjects.map(&:matcher)), predicate: method(:allowed_subject?).curry.call(config) ) end |
.ignore_subject?(config, subject) ⇒ Boolean
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.
Predicate that tests for ignored subject
46 47 48 49 50 |
# File 'lib/mutant/matcher.rb', line 46 def self.ignore_subject?(config, subject) config.ignore.any? do |expression| expression.prefix?(subject.expression) end end |
Instance Method Details
#call ⇒ Enumerable<Subject>
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.
Call matcher
14 |
# File 'lib/mutant/matcher.rb', line 14 abstract_method :call |