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
Constant Summary collapse
- BLACKLIST =
Methods within rbx kernel directory are precompiled and their source cannot be accessed via reading source location
/\Akernel\//.freeze
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, false
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
51 52 53 |
# File 'lib/mutant/matcher/method.rb', line 51 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
59 60 61 |
# File 'lib/mutant/matcher/method.rb', line 59 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
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/mutant/matcher/method.rb', line 33 def each(&block) return to_enum unless block_given? return self if skip? 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
67 68 69 |
# File 'lib/mutant/matcher/method.rb', line 67 def method_name method.name end |
#public? ⇒ true, false
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
81 |
# File 'lib/mutant/matcher/method.rb', line 81 abstract_method :public? |