From: William Morgan Date: 2005-03-13T04:54:54+09:00 Subject: Re: Ruby black magic? Meta Programming Excerpts from ES's mail of 12 Mar 2005 (EST): > You can achieve the same effect by creating a meta for something like > def_pre :methodname, def_post :methodname with associated blocks. Then > alias the actual :methodname, make the pre block respond to > :methodname; pre executes its block and then calls :methodname, after > which post block is called. See http://www.thekode.net/ruby/techniques/CapturingMethods.html for an example implementation (which doesn't use alias). But there are limitations to this technique that will only be resolved in 2.0. -- William