method
const_defined?
v1_9_3_392 -
Show latest stable
- Class:
Module
const_defined?(p1, p2 = v2)public
Checks for a constant with the given name in mod If inherit is set, the lookup will also search the ancestors (and Object if mod is a Module.)
Returns whether or not a definition is found:
Math.const_defined? "PI" #=> true IO.const_defined? :SYNC #=> true IO.const_defined? :SYNC, false #=> false