Class: Mutant::Matcher

Inherits:
Object
  • Object
show all
Extended by:
DescendantsTracker
Includes:
AbstractType, Adamantium::Flat, Enumerable
Defined in:
lib/mutant/matcher.rb,
lib/mutant/matcher/null.rb,
lib/mutant/matcher/chain.rb,
lib/mutant/matcher/scope.rb,
lib/mutant/matcher/filter.rb,
lib/mutant/matcher/method.rb,
lib/mutant/matcher/methods.rb,
lib/mutant/matcher/namespace.rb,
lib/mutant/matcher/method/finder.rb,
lib/mutant/matcher/method/instance.rb,
lib/mutant/matcher/method/singleton.rb

Overview

Abstract matcher to find subjects to mutate

Direct Known Subclasses

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

Defined Under Namespace

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(*arguments) ⇒ undefined

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.

Default matcher build implementation

Parameters:

  • cache (Cache)
  • input (Object)

Returns:

  • (undefined)


38
39
40
# File 'lib/mutant/matcher.rb', line 38

def self.build(*arguments)
  new(*arguments)
end

.each(cache, input, &block) ⇒ self, 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.

Enumerate subjects

Parameters:

  • input (Object)

Returns:

  • (self)

    if block given

  • (Enumerable<Subject>)

    otherwise



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

def self.each(cache, input, &block)
  return to_enum(__method__, cache, input) unless block_given?

  build(cache, input).each(&block)

  self
end

Instance Method Details

#eachself, Enumerabe<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.

Enumerate subjects

Returns:

  • (self)

    if block given

  • (Enumerabe<Subject>)

    otherwise



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

abstract_method :each

#identificationString

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.

Return identification

Returns:

  • (String)

    String



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

abstract_method :identification