From: Martin DeMello Date: 2006-12-06T21:03:24+09:00 Subject: Re: How do I catch a missing method on a passed block? On 12/6/06, Tim Fletcher wrote: > Logan Capaldo wrote: > > > > > If ruby were common lisp, that could actually work. But it's not and our > > exceptions are not resuamble :). > > class Foo > def bar > yield > rescue NameError => method_call > p method_call.name > end > end > > Foo.new.bar { baz } Breaks: irb(main):008:0> a = Foo.new => # irb(main):009:0> a.bar { baz } :baz => nil irb(main):010:0> a.bar { baz; quux } :baz => nil martin