03-27-2012, 03:30 PM
After all of these years, I have finally figured out how to determine whether a CONSTANT is defined or not. This was probably a no-brainer to anybody else, but this is big news to me. Here I was thinking I can't ever make a conditional checking if constants were defined, and here it is, I feel stupid for not knowing about it until now.
I might start using this a lot. Maybe.
Code:
self.class.const_defined?(:CONSTANT)
I might start using this a lot. Maybe.