From: J2M Date: 2006-12-13T03:09:43+09:00 Subject: Re: How do I catch a missing method on a passed block? dblack@wobblini.net wrote: > I'd have to see the current version of the code to be sure, but > define_method gives you a closure, so if you have a local variable > outside it, that variable will be captured. Or maybe an instance > variable. Can you post what you've currently got? class Foo def bar(*args, &block) if block_given? class << block @@return = {} lambd.define_method(:method_missing, (m, *args, &b) return @@return.merge!({ m.to_sym => args }) end end attributes = lambd.instance_eval(&block) end p attributes end end # Foo Thanks David, this is a good education for me. James