method
const_defined?

const_defined?(p1, p2 = v2)
public
Returns true if a constant with the given name is defined by mod, or its ancestors if inherit is not false.
Math.const_defined? "PI" #=> true IO.const_defined? "SYNC" #=> true IO.const_defined? "SYNC", false #=> false