Method: DataMapper::Inflector#demodulize
- Defined in:
- lib/dm-core/support/inflector/methods.rb
#demodulize(class_name_in_module) ⇒ Object
Removes the module part from the expression in the string.
Examples:
"ActiveRecord::CoreExtensions::String::Inflections".demodulize # => "Inflections"
"Inflections".demodulize # => "Inflections"
71 72 73 |
# File 'lib/dm-core/support/inflector/methods.rb', line 71 def demodulize(class_name_in_module) class_name_in_module.to_s.gsub(/^.*::/, '') end |