Class: Mutant::Subject::Method::Singleton
- Inherits:
-
Mutant::Subject::Method
- Object
- Mutant::Subject
- Mutant::Subject::Method
- Mutant::Subject::Method::Singleton
- Defined in:
- lib/mutant/subject/method/singleton.rb
Overview
Singleton method subjects
Constant Summary collapse
- NAME_INDEX =
1
- SYMBOL =
'.'.freeze
Instance Method Summary collapse
-
#prepare ⇒ self
private
Prepare subject for mutation insertion.
-
#public? ⇒ Boolean
private
Test if method is public.
Methods inherited from Mutant::Subject::Method
#expression, #match_expressions, #name
Methods inherited from Mutant::Subject
#expression, #identification, #match_expressions, #mutations, #source, #source_line, #source_lines, #source_path
Instance Method Details
#prepare ⇒ 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.
Prepare subject for mutation insertion
25 26 27 28 |
# File 'lib/mutant/subject/method/singleton.rb', line 25 def prepare scope.singleton_class.__send__(:undef_method, name) self end |
#public? ⇒ Boolean
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
15 16 17 |
# File 'lib/mutant/subject/method/singleton.rb', line 15 def public? scope.singleton_class.public_method_defined?(name) end |