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/chain.rb,
lib/mutant/matcher/method.rb,
lib/mutant/matcher/object_space.rb,
lib/mutant/matcher/scope_methods.rb,
lib/mutant/matcher/method/instance.rb,
lib/mutant/matcher/method/singleton.rb,
lib/mutant/matcher/method/classifier.rb

Overview

Abstract matcher to find ASTs to mutate

Direct Known Subclasses

Chain, Method, ObjectSpace, ScopeMethods

Defined Under Namespace

Classes: Chain, Method, ObjectSpace, ScopeMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_string(input) ⇒ 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.

Return match from string

Parameters:

  • input (String)

Returns:

  • (Matcher)

    returns matcher input if successful

  • (nil)

    returns nil otherwise



48
49
50
51
52
53
54
55
# File 'lib/mutant/matcher.rb', line 48

def self.from_string(input)
  descendants.each do |descendant|
    matcher = descendant.parse(input)
    return matcher if matcher
  end

  nil
end

.parse(input) ⇒ nil

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 matcher

Parameters:

  • input (String)

Returns:

  • (nil)

    returns nil as default implementation



32
33
34
# File 'lib/mutant/matcher.rb', line 32

def self.parse(input)
  nil
end

Instance Method Details

#eachundefined

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:

  • (undefined)


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

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



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

abstract_method :identification