From: Lars Christensen Date: 2001-08-07T08:52:43+09:00 Subject: [ruby-talk:19262] Dereference operator Hi, I was just wondering about the possibility for overloading of what in C++ is called the dereferencing operator. That is, so you could do something like: class Proxy def initialize(obj); @obj = obj; end def . (aSymbol, *args) if @obj.respond_to? aSymbol @obj.send(aSymbol, *args) else send(aSymbol, *args) end end end foo = "foobar" bar = Proxy.new(foo) p bar #=> "foobar" This will totally masquarade the proxied object whereas the overloading of missing_method will not allow proxying of methods already in Proxy. -- Lars Christensen, larsch@cs.auc.dk