7293386c26
* rubocop still warns about this on ruby 1.9.3, so it was fixed so it produces less output on travis.
30 lines
572 B
Ruby
30 lines
572 B
Ruby
# encoding: utf-8
|
|
|
|
module Mutant
|
|
class Subject
|
|
class Method
|
|
# Singleton method subjects
|
|
class Singleton < self
|
|
|
|
NAME_INDEX = 1
|
|
SYMBOL = '.'.freeze
|
|
|
|
# Test if method is public
|
|
#
|
|
# @return [true]
|
|
# if method is public
|
|
#
|
|
# @return [false]
|
|
# otherwise
|
|
#
|
|
# @api private
|
|
#
|
|
def public?
|
|
scope.singleton_class.public_method_defined?(name)
|
|
end
|
|
memoize :public?
|
|
|
|
end # Singleton
|
|
end # Method
|
|
end # Subject
|
|
end # Mutant
|