P
Peter Szinek
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
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