Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

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}")

On Fri, 9 Dec 2005, Trans wrote:
> require 'facet/kernel/constant'>> name = 'MyModule'> o = Object.new> o.extend(constant(name))>> T.
we have dueling libraries tom! ;-)
guess the fact that we are both writing these function over and over
means
they are useful.
cheers.
-a