From: james@... Date: 2002-07-04T03:56:38+09:00 Subject: RE: Class.forName("Array") > > Is it possible to create an object of the class > 'Class' dynamically? > > Fox example: to create an object of 'Class' with the > value of 'Hash' by something like: Class.new('Hash') > or Class.forName('Hash') > > Isn't it very useful? There was code for this posted on ruby-talk not too long ago, by Dave Thomas (I think): def for_name(className) ObjectSpace.each_object(Class) do |c| return c if c.name == className end raise "Class #{className} not found" end > > __________________________________________________ > Do You Yahoo!? > Sign up for SBC Yahoo! Dial - First Month Free > http://sbc.yahoo.com >