From: "ara.t.howard" Date: 2008-09-17T07:32:06+09:00 Subject: Re: define anonymous module with closure On Sep 16, 2008, at 2:17 PM, I. E. Smith-Heisters wrote: > brilliant! thanks for the explanation and solution all in one. np. if you need a block then: cfp:~ > cat a.rb x, y = %w( x y ) m = Module.new do @@x = x def z *args, &block block.call if block @@x end end y.extend m p y.z # => 'x' y.z{ puts 'you need to do it this way if you want your method to take a block' } cfp:~ > ruby a.rb "x" you need to do it this way if you want your method to take a block a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama