File: singleton_class.rb

package info (click to toggle)
ruby-backports 3.25.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,912 kB
  • sloc: ruby: 11,759; makefile: 6
file content (8 lines) | stat: -rw-r--r-- 161 bytes parent folder | download
1
2
3
4
5
6
7
8
unless Module.method_defined? :singleton_class?
  class Module
    def singleton_class?
      # Hacky...
      inspect.start_with? '#<Class:#'
    end
  end
end