From: Jamis Buck Date: 2004-08-15T05:14:59+09:00 Subject: Re: creating classes on the fly Claus Spitzer wrote: > Great! Thanks for the quick response. Just another quick one on that context: > > Now that I have the class definition and can extend it easily, I'm > wondering how I would do > > qux = Klass.new > > using str1 or klass. I could do > > eval "qux = #{str}.new" > > and that would be fine, but it somehow seems forced. Any hints? > Hmm. If I understand the question, the following should work: klass = eval( str ) qux = klass.new - Jamis -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis "I use octal until I get to 8, and then I switch to decimal."