Class: Object

Inherits:
BasicObject
Defined in:
lib/method_profiler/core_ext/object.rb

Overview

Backports Object#singleton_class from Ruby 1.9.2

Instance Method Summary collapse

Instance Method Details

#singleton_classObject

Returns the singleton class of an object.

Returns:

  • (Object)

    The object’s singleton class.



6
7
8
# File 'lib/method_profiler/core_ext/object.rb', line 6

def singleton_class
  class << self; self end
end