Just out of curiosity, do you know why constantize uses module_eval and not const_get?
If I was doing it without constantize, I would do it as:
begin obj = Kernel.const_get(my_str).new rescue puts "no class named #{my_str}" end
Michael
Just out of curiosity, do you know why constantize uses module_eval and not const_get?
If I was doing it without constantize, I would do it as:
begin obj = Kernel.const_get(my_str).new rescue puts "no class named #{my_str}" end
Michael