Actions
Feature #7609
closedClass#singleton_class?
    Feature #7609:
    Class#singleton_class?
  
Description
Related to #7554, there is no way to tell the called method is a singleton method or an ordinary method.
Files
Actions
        
        
    Added by nobu (Nobuyoshi Nakada) almost 13 years ago. Updated about 12 years ago.
Description
Related to #7554, there is no way to tell the called method is a singleton method or an ordinary method.
Files
| singleton_class_p.patch (1.34 KB) singleton_class_p.patch | nobu (Nobuyoshi Nakada), 12/23/2012 05:48 PM | 
Moving to Feature requests.
Just curious about use case?
Also, can be hacked in Ruby already...
class Class
  def singleton_class?
    Class.new(self) && true rescue false
  end
end
OK.
This issue was solved with changeset r42449.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
object.c: Module#singleton_class?