public Method

Inflector.demodulize(class_name_in_module)

Removes the module part from the expression in the string

Examples

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

Source Code

# File merb/core_ext/inflector.rb, line 199
def demodulize(class_name_in_module)
  class_name_in_module.to_s.gsub(/^.*::/, '')
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.