From: Ross Bamford Date: 2005-12-09T21:47:35+09:00 Subject: Re: extend an object using string as module name? On Thu, 08 Dec 2005 18:37:43 -0800, ako... wrote: > hello, > > is this a proper way to do it: > > name = 'MyModule' > o = Object.new > o.extend(Module.const_get(name)) > > I don't know if this is the proper way, but you could just eval the name: name = 'MyModule' o = Object.new o.extend( eval name ) Or alternatively: eval("o.extend #{name}") -- Ross Bamford - rosco@roscopeco.remove.co.uk "\e[1;31mL"