mod.const_defined?(sym, inherit=true) â true or false
Instance Public methods
Says whether mod or its ancestors have a constant with the given
name:
Float.const_defined?(:EPSILON) #=> true, found in Float itself
Float.const_defined?("String") #=> true, found in Object (ancestor)
BasicObject.const_defined?(:Hash) #=> false
If mod is a Module, additionally Object
and its ancestors are checked:
Math.const_defined?(:String) #=> true, found in Object
In ea