Class: Object

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) singleton_class(&block)



65
66
67
68
69
70
71
# File 'lib/bj/stdext.rb', line 65

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