Class: Object

Inherits:
BasicObject
Defined in:
lib/main/stdext.rb

Instance Method Summary collapse

Instance Method Details

#singleton_class(object = self, &block) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/main/stdext.rb', line 2

def singleton_class(object = self, &block)
  singleton_class =
    class << object
      self
    end
  block ? singleton_class.module_eval(&block) : singleton_class
end