Class: Object

Inherits:
BasicObject
Defined in:
lib/bj/stdext.rb,
lib/bj/stdext.rb

Instance Method Summary collapse

Instance Method Details

#singleton_class(&block) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/bj/stdext.rb', line 38

def singleton_class &block
  tmp = @singleton_class ||
    class << self
      self
    end
  block ? tmp.module_eval(&block) : tmp
end