Class: Mutant::Matcher::Methods
- Inherits:
-
Mutant::Matcher
- Object
- Mutant::Matcher
- Mutant::Matcher::Methods
- Includes:
- AbstractType
- Defined in:
- lib/mutant/matcher/methods.rb
Overview
Abstract base class for matcher that returns method subjects from scope
Defined Under Namespace
Instance Method Summary collapse
-
#each(&block) ⇒ self, Enumerator<Subject>
private
Enumerate subjects.
-
#matcher ⇒ Class:Matcher::Method
private
Return method matcher class.
-
#methods ⇒ Enumerable<Method, UnboundMethod>
private
Return methods.
Methods inherited from Mutant::Matcher
Instance Method Details
#each(&block) ⇒ self, Enumerator<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
19 20 21 22 23 24 25 26 27 |
# File 'lib/mutant/matcher/methods.rb', line 19 def each(&block) return to_enum unless block_given? methods.each do |method| emit_matches(method, &block) end self end |
#matcher ⇒ Class: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.
Return method matcher class
35 36 37 |
# File 'lib/mutant/matcher/methods.rb', line 35 def matcher self.class::MATCHER end |
#methods ⇒ Enumerable<Method, UnboundMethod>
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 methods
45 46 47 48 49 50 |
# File 'lib/mutant/matcher/methods.rb', line 45 def methods candidate_names.each_with_object([]) do |name, methods| method = access(name) methods << method if method.owner == candidate_scope end end |