From: "Brian Schröder" Date: 2004-11-14T01:30:19+09:00 Subject: Re: Getting Module from Symbol On Sun, 14 Nov 2004 01:19:55 +0900 ts wrote: > >>>>> "B" == Brian =?ISO-8859-15?Q?Schr=F6der?= writes: > > B> I want to use methods in different modules depending on commandline switches. So I thought i'd use > B> module Module1 > B> module SubModule1 > B> def foo() end > > module_function :foo > > B> end > > [...] > > B> m1 = Module1 > B> m2 = SubModule1 > > B> m1::m2::foo() > > m1 = Module1 > m2 = m1.const_get(:SubModule1) > m2::foo > > > Guy Decoux > > > Thank you, I knew there was something. But what is the const_get equivalent for object, such that I can use: m = const_get(:Module1).const_get(:SubModule1) Regards, Brian -- Brian Schr�der http://www.brian-schroeder.de/