class String
def safe_constantize
'blargle'.safe_constantize # => nil
'Class'.safe_constantize # => Class
'Module'.safe_constantize # => Module
or is not initialized.
in the string. It returns +nil+ when the name is not in CamelCase
+safe_constantize+ tries to find a declared constant with the name specified
def safe_constantize ActiveSupport::Inflector.safe_constantize(self) end