instance method
demodulize
Ruby on Rails 3.2.22.5
Since v2.2.3Signature
demodulize(path)
Removes the module part from the expression in the string:
"ActiveRecord::CoreExtensions::String::Inflections".demodulize # => "Inflections" "Inflections".demodulize # => "Inflections"
See also deconstantize.
Parameters
-
pathreq
Source
# File activesupport/lib/active_support/inflector/methods.rb, line 159
def demodulize(path)
path = path.to_s
if i = path.rindex('::')
path[(i+2)..-1]
else
path
end
end
Defined in activesupport/lib/active_support/inflector/methods.rb line 159
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Inflector