if Object.const_defined?(:YourConstant) puts "Constant exists!" else puts "Constant does not exist." end