From: Bernd Burnt Date: 2007-07-04T21:37:17+09:00 Subject: Re: Verify if a class exists Simen Edvardsen wrote: > On 7/4/07, Bernd wrote: >> >> > > Try a const_get. Like so: > > def class_exists?(name) > begin > true if Kernel.const_get(name) > rescue NameError > false > end > end Hi, first of all, thanks for your help, Simen. I think, I even found a better solution, I assign the name to the class with Object.const_set class_name, klass So I can determine, whether the class exists with Object const_defined? class_name You are using exception handling (rescue) for a conditional branch, which I try to avoid whenever possible, to keep my code well structured. -- Posted via http://www.ruby-forum.com/.