From: Eric Hodel Date: 2007-01-10T01:45:50+09:00 Subject: Re: Proc code On Jan 8, 2007, at 19:35, Marc Soda wrote: > Is there a way to get the code (or, more importantly, the variables) > out of a block associated with a Proc? For example: > > foo = lamdba { a = 'bar'; puts a } > p foo.source > > produces "a = 'bar'; puts a" > > I thought about extending Proc and saving the block in initialize, but > this seems like a lot of overhead if you have a lot of Procs. > > Any better ideas? Use the ruby2ruby gem. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net I LIT YOUR GEM ON FIRE!