From: Nikolai Weibull Date: 2012-03-23T21:35:29+09:00 Subject: Re: What’s the best way to check if a feature/class has been loaded? On Thu, Mar 22, 2012 at 10:09, Xavier Noria wrote: > OK, I think I know what you are looking for: > > Given a name "C::String" you want to know if there exists a constant C, and inside that one you want to check for a constant String. In the latter check, only the constants in C have to be checked, nor ancestors neither Object. > > In addition to that you want const_missing to be triggered as needed (and that does not hold for qualified_const_defined? in particular). > > Is that right? I suppose so. I have, however, reworked my code and am instead using the $LOADED_FEATURES check. It works for what I need and since there’s really no way to solve it with constants in a uniform and simple way, that’ll do. > Is there anything else to add related to required paths? The point was that it needn’t necessarily be a check for constants being defined. I don’t really think we can get any further in this thread. Thank you for your input and I hope that this has been an educational thread on dealing with constants in Ruby to more subscribers than me.