From: Brian Candler Date: 2011-03-13T23:26:01+09:00 Subject: Re: send() with a block? Peter Zotov wrote in post #987115: > On Sun, 13 Mar 2011 06:01:31 +0900, Sean O'Halpin wrote: >> define_method(). >> > > But send() still bothers to pass the block around. Consider the > following code: > > ---8<---8<--- > def my_method > p block_given? > end > > def my_send # imitating send > my_method > end > > my_send # => false > ---8<---8<--- But compare with this: def my_method p block_given? end def my_send(&blk) # imitating send my_method(&blk) end my_send # => false my_send { :wibble } # => true -- Posted via http://www.ruby-forum.com/.