Hi,

thank you for reading my post. I'll shortly describe my problem.

I want to probe if a class is defined, and if it is, I want to
instantiate it. Let's assume, the class name is "DemandType" and it
exists:

Object.const_defined?("DemandType") => false
Object.const_get("DemandType") => Class

Why does const_defined?() returns false in this case? I have also
tested it in rails console, but it was not successful. I could also
work with const_get() alone and catch the NameError exception, but I
would really like to know why const_defined?() is not working.

Thank you very much in advance!
ms

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to