Hi,

In message "[ruby-talk:26527] delegates and weakref"
    on 01/11/27, Paul Brannan <pbrannan / atdesk.com> writes:

|It seems that a DelegateClass does not properly delegate to a WeakRef:

|Anyone know why this is happening?  Any ideas on a workaround (I know I
|can use a SimpleDelegate, but that has costs)?

It's the limitation.  WeakRef is not a "cooked" class, i.e. it doesn't
complete without specifying target in the "initialize". So,

  require 'weakref'
  class Foo
    def method_missing(*args)
      p args
    end
  end

  f = Foo.new
  f.foo

  w = WeakRef.new(f)
  w.foo

  b = SimpleDelegator.new(w)
  b.foo

is the only way to accomplish what you want, I suspect.

							matz.