Remove the module namespace of a qualified Ruby class name

Posted Almost 12 years ago. Visible to the public.

You can use String#demodulize Show archive.org snapshot from ActiveSupport:

"ActiveRecord::CoreExtensions::String::Inflections".demodulize # => "Inflections"
"Inflections".demodulize                                       # => "Inflections"
Henning Koch
Last edit
About 11 years ago
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2012-08-02 14:24)