From: Joe Van Dyk Date: 2005-10-14T08:05:06+09:00 Subject: Re: Challenging Project ... Need a deep guru to provide enlightenment. On 10/13/05, Jeff Wood wrote: > I think I've got a very challenging project on my hands but here's I'm > trying to create. > > I want a completely clean(transparent) proxy object. > > One where ALL methods simply return the result of the same call on the > proxied ( not the proxy ) object. > > I mean, if the user wants to add/override methods, that's fine, but by > default, EVERY call should be passed through. > > I hope that makes sense... > > So: > > a = String > b = Proxy.new( a ) Would b = > # should be the same > a.class > b.class > > # should be the same > a.methods > b.methods > > I want it be completely transparent. Not too hard, I think: def create_proxy klass klass.dup end a = String b = create_proxy a Unless I'm not understanding something correctly.