From: J2M Date: 2006-12-13T00:52:34+09:00 Subject: Re: How do I catch a missing method on a passed block? dblack@wobblini.net wrote: > >>> What made this sweet for me was turning the &block into a lambda let me > >>> return the result from the instance_eval to bar where other solutions > >>> kept them in scope of the &block. > >> > >> But the block *is* a lambda :-) That's what the &block argument does: > >> it captures the code block in an object and assigns a variable to it. > > > > But without the lambda it is a raw proc that doesn't return the result > > of the method - from what I understand from page 344 of Pickaxe. I > > tried without and didn't get the result passed back from > > method_missing, but I will now test that again :-) > > You may be right; I didn't demo it because I couldn't figure out > exactly what code I needed to add :-) You may be hitting one of the > Proc/proc/lambda/block difference things. You are right David, I chopped the lambda and it still works ;-/ I don't see how to get rid of the class variable as I am building a hash from the repeated call to method_missing inside the block then returning that through the instance_eval, if I don't use the class variable, I will only get the result of the last call to method_missing? James