From: Gavin Sinclair Date: 2003-12-06T12:05:17+09:00 Subject: Re: Using Modules as Decorators On Saturday, December 6, 2003, 6:12:03 AM, Nathan wrote: >> >> > #Call the original definition of name on object >> > def call_orig(obj, name, *args) >> > obj.send(orig_name(name), *args) >> > end >> def call_orig(obj, name, *args, &block) >> obj.__send__(orig_name(name), *args, &block) >> end > What does __send__ do? And what's the block for? __send__ (commonly known as send) sends a message to an object. [1,2,3].send(:length) # => 3 __send__ is the canonical method, in case someone overwrites send. The block is included just so it gets passed on if provided. Gavin