From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2001-04-23T06:40:08+09:00 Subject: [ruby-talk:14040] RCR: getClassFromString method It would be nice to have a function that returns a class type given a string that names that class. I realize that this is doable already in at least a couple of different ways - you can use the each_object method in ObjectSpace to iterate through all of the classes till you find the one you need, or you can use const_get in Modules, (at least that's where I think it is), but none of those ways is intuitive and easy to figure out for newbies. So, in the spirit of "the principle of least surprise", I propose that we have a function called getClassFromString (or classFromString) that would do this as well as handling cases where there is class hierarchy (like MyClasses::ThisClass). This should be built-in functionality. I'm not sure where the best place is to put such a method, but I suspect it would be best to put it in Object or ObejectSpace. Phil