Mat Schaffer
12/27/2006 4:14:00 AM
On Dec 26, 2006, at 6:52 PM, James Britt wrote:
> cedric.ch wrote:
>> Hi,
>> I would to know if it is possible to do something like that:
>> def create_object(class_name)
>> my_object = **class_name**.new
>> end
>> I tried with class.new(&class_name)
>
>
> x = Object.const_get( class_name ).new
Does that still work if there's a module mentioned in the string with
'::' included? I seem to remember a discussion or maybe an
eigenclass blog entry that mentioned the problem. But maybe I'm wrong.
-Mat