Class: Mutant::Matcher Private

Inherits:
Object
  • Object
show all
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

Direct Known Subclasses

Chain, Descendants, Filter, Method, Methods, Namespace, Null, Scope

Defined Under Namespace

Classes: Chain, Config, Descendants, Filter, Method, Methods, Namespace, Null, Scope, Static

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.expand(env:) ⇒ 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

Parameters:

Returns:



21
22
23
24
25
26
27
28
# File 'lib/mutant/matcher.rb', line 21

def self.expand(env:)
  matcher_config = env.config.matcher

  Filter.new(
    matcher:   Chain.new(matchers: matcher_config.subjects.map { |subject| subject.matcher(env:) }),
    predicate: method(:allowed_subject?).curry.call(matcher_config)
  )
end

Instance Method Details

#callEnumerable<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

Parameters:

Returns:



14
# File 'lib/mutant/matcher.rb', line 14

abstract_method :call