Method: String#demodulize
- Defined in:
- lib/sequel_model/inflector.rb
#demodulize ⇒ Object
Removes the module part from the expression in the string
Examples
"ActiveRecord::CoreExtensions::String::Inflections".demodulize #=> "Inflections"
"Inflections".demodulize #=> "Inflections"
195 196 197 |
# File 'lib/sequel_model/inflector.rb', line 195 def demodulize gsub(/^.*::/, '') end |