Class: Mutant::Matcher::Method
- Inherits:
-
Mutant::Matcher
- Object
- Mutant::Matcher
- Mutant::Matcher::Method
- Includes:
- Adamantium::Flat
- Defined in:
- lib/mutant/matcher/method.rb,
lib/mutant/matcher/method/instance.rb,
lib/mutant/matcher/method/singleton.rb,
lib/mutant/matcher/method/classifier.rb
Overview
Matcher for subjects that are a specific method
Defined Under Namespace
Classes: Classifier, Instance, Singleton
Instance Attribute Summary collapse
-
#method ⇒ UnboundMethod, Method
readonly
private
Return method.
-
#scope ⇒ Class|Module
readonly
private
Return scope.
Class Method Summary collapse
-
.parse(input) ⇒ Matcher::Method
private
Parse a method string into filter.
Instance Method Summary collapse
-
#each(&block) ⇒ Enumerable, self
private
Enumerate matches.
-
#method_name ⇒ String
private
Return method name.
-
#public? ⇒ true
private
Test if method is public.
Methods inherited from Mutant::Matcher
Instance Attribute Details
#method ⇒ UnboundMethod, Method (readonly)
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 method
50 51 52 |
# File 'lib/mutant/matcher/method.rb', line 50 def method @method end |
#scope ⇒ Class|Module (readonly)
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 scope
58 59 60 |
# File 'lib/mutant/matcher/method.rb', line 58 def scope @scope end |
Class Method Details
.parse(input) ⇒ Matcher::Method
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.
Parse a method string into filter
15 16 17 |
# File 'lib/mutant/matcher/method.rb', line 15 def self.parse(input) Classifier.run(input) end |
Instance Method Details
#each(&block) ⇒ Enumerable, self
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 matches
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/mutant/matcher/method.rb', line 29 def each(&block) return to_enum unless block_given? unless source_location $stderr.puts "#{method.inspect} does not have source location unable to emit matcher" return self end subject.tap do |subject| yield subject if subject end self end |
#method_name ⇒ String
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 method name
66 67 68 |
# File 'lib/mutant/matcher/method.rb', line 66 def method_name method.name end |
#public? ⇒ true
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.
Test if method is public
80 |
# File 'lib/mutant/matcher/method.rb', line 80 abstract_method :public? |