class String

def constantize

Experimental RBS support (using type sampling data from the type_fusion project).

def constantize: () -> (Class | Module)

This signature was generated using 6 samples from 2 applications.

See ActiveSupport::Inflector.constantize.

'blargle'.constantize # => NameError: wrong constant name blargle
'Class'.constantize # => Class
'Module'.constantize # => Module

or is not initialized.
in the string. It raises a NameError when the name is not in CamelCase
+constantize+ tries to find a declared constant with the name specified
def constantize
  ActiveSupport::Inflector.constantize(self)
end