> -----Original Message-----
> From: nosuzuki / e-mail.ne.jp [mailto:nosuzuki / e-mail.ne.jp]On Behalf Of
> Benoit Cerrina
> Sent: Monday, May 21, 2001 10:40 AM
> To: ruby-talk ML; ruby-talk / netlab.co.jp
> Subject: [ruby-talk:15458] Re: Newbye question: retrieving a Class by
> its classname
>
>
> of course I meant return eval("#{name}"), this is just a typo, my question
> is still valid
module TestModule
	class TestClass
		def TestClass.test
		end
	end
end

(TestModule.const_get 'TestClass').test

if you are at root level, you may use plain const_get:
class TestClass
	def TestClass.test
	end
end
(const_get 'TestClass').test

Aristarkh A Zagorodnikov, Lead Programmer, W3D Group
http://www.w3d.ru /// xm / w3d.ru /// ICQ UIN 36987938