From: Florian Gross Date: 2004-09-29T05:49:21+09:00 Subject: Re: metaprogramming question, alternatives to "class ..." Kevin McConnell wrote: >> [snip] > That's exactly what I was looking for, thanks. Small correction: def datasource(name, &block) module = Module.nesting.first || Object module.const_set(name, Class.new(DataSourceBase, &block)) end That will fix this case: module X datasource(:AddressDataSource) do ... end end > Cheers, > Kevin Regards, Florian Gross