From: Peter Szinek Date: 2006-12-04T20:20:59+09:00 Subject: Getting the source code of a block Hello, Is the following thing possible somehow? def foo(&bar) do_something_with(bar) end baz = foo { puts 'hello'; i +=1; fluff(ork) } now, baz should contain the string "puts 'hello'; i +=1; fluff(ork)" since I need to do this in the same file where I am defining the block, I could get it using __FILE__ + some regexps - just asking if there is some more elegant way... TIA, Peter __ http://www.rubyrailways.com