From singleton.rb:

  def included(klass)
    super
    klass.private_class_method  :new, :allocate
    klass.extend SingletonClassMethods
    Singleton.__init__(klass)
  end

and a bit earlier:

  def __init__(klass)
    klass.instance_eval { @__instance__ = nil }
    ...

Perhaps that should be instead:

    klass.instance_eval { @__instance__ = nil unless defined? 
@__instance__ }

Or somewhat more obscure, I think this would do:

    klass.instance_eval { @__instance__ ||= nil }

-- 
Posted via http://www.ruby-forum.com/.