From: Peter Hickman Date: 2005-01-17T22:34:47+09:00 Subject: Re: Creating an instance from a variable Robert Klemme wrote: >You need to catch NameError. > >class Builder > def Builder.create( klass_sym, data ) > begin > return Kernel.const_get( klass_sym ).new( data ) > rescue NameError => e > raise "There was an error: #{e}" > end > end >end > > > robert > Thanks for that, I thought that an open rescue would have caught it. Live and learn. Thanks