Method: String#demodulize

Defined in:
lib/core_ext/string/inflections.rb

#demodulizeObject

Removes the module part from the constant expression in the string.

'ActiveRecord::CoreExtensions::String::Inflections'.demodulize # => "Inflections"
'Inflections'.demodulize                                       # => "Inflections"
'::Inflections'.demodulize                                     # => "Inflections"
''.demodulize                                                  # => ''

See also deconstantize.



137
138
139
# File 'lib/core_ext/string/inflections.rb', line 137

def demodulize
  CoreExt::Inflector.demodulize(self)
end