Class: Mutant::Matcher::Method::Singleton

Inherits:
Mutant::Matcher::Method show all
Defined in:
lib/mutant/matcher/method/singleton.rb

Overview

Matcher for singleton methods

Constant Summary

Constants inherited from Mutant::Matcher::Method

BLACKLIST

Instance Attribute Summary

Attributes inherited from Mutant::Matcher::Method

#method, #scope

Instance Method Summary collapse

Methods inherited from Mutant::Matcher::Method

#each, #method_name, parse

Methods inherited from Mutant::Matcher

#each, from_string, parse

Instance Method Details

#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)


13
14
15
# File 'lib/mutant/matcher/method/singleton.rb', line 13

def identification
  "#{scope.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

Returns:

  • (true)

    if method is public

  • (false)

    otherwise



28
29
30
# File 'lib/mutant/matcher/method/singleton.rb', line 28

def public?
  scope.singleton_class.public_method_defined?(method_name)
end