From: Kevin McConnell Date: 2004-09-29T05:19:21+09:00 Subject: metaprogramming question, alternatives to "class ..." Folks, I'm starting to dabble in using some of Ruby's metaprogramming features, in an effort to use actual code in place of configuration files. It's got me to wondering if there's a way to define a method to take the place of a class declaration. In other words, say I have something like this: class AddressDataSource < DataSourceBase field :name, "customer_name" field :address, "cust_addr" end ....is there any cunning trickery that would allow me to do this: datasource AddressDataSource field :name, "customer_name" field :address, "cust_addr" end I couldn't think of a way to have a method than can parse up until the matching "end". But, there's a lot of stuff I read here that I wouldn't have thought of myself :-) Cheers, Kevin