Class: Mutant::Matcher Private

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Adamantium::Flat
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/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, Filter, Method, Methods, Namespace, Null, Scope

Defined Under Namespace

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

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

Returns:



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

def self.from_config(config)
  Filter.new(
    Chain.new(config.match_expressions.map(&:matcher)),
    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

Parameters:

Returns:

  • (Boolean)


44
45
46
47
48
# File 'lib/mutant/matcher.rb', line 44

def self.ignore_subject?(config, subject)
  config.ignore_expressions.any? do |expression|
    expression.prefix?(subject.expression)
  end
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