Class: Object

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

Overview

Provides the singleton_class method for Ruby implementations not supporting it

Author:

  • Sebastian Staudt

Instance Method Summary collapse

Instance Method Details

#singleton_classClass

Returns the singleton class (also known as eigenclass) of this object

Returns:

  • (Class)

    The singleton class of this object



17
18
19
20
21
# File 'lib/core_ext/object.rb', line 17

def singleton_class
  class << self
     self
  end
end