From: Kevin McConnell Date: 2004-09-29T05:39:20+09:00 Subject: Re: metaprogramming question, alternatives to "class ..." Florian Gross wrote: > You can have this: > > datasource(:AddressDataSource) do > field :name, "customer_name" > field :address, "cust_addr" > end > > With this: > > def datasource(name, &block) > Object.const_set(name, Class.new(DataSourceBase, &block)) > end That's exactly what I was looking for, thanks. Cheers, Kevin