From: Thomas Leitner Date: 2005-01-17T20:21:19+09:00 Subject: Re: Creating an instance from a variable On Mon, 17 Jan 2005 19:54:47 +0900 Peter Hickman wrote: | I have a class like this: | | class Builder | def Builder.create( klass, data ) | return klass.new(data) | end | end use (I have not tested this): class Builder def Builder.create( klass, data ) return Object.const_get(klass).new(data) end end *hth*, Thomas -- |\ Thomas Leitner -- thomas [underscore] leitner [at] gmx [dot] at |> |/ "Life is what happens to you while you're busy making other plans"