instance method
demodulize
Ruby on Rails edge
Signature
demodulize(path)
Removes the module part from the expression in the string.
“‘ demodulize(’ActiveSupport::Inflector::Inflections’) # => “Inflections” demodulize(‘Inflections’) # => “Inflections” demodulize(‘::Inflections’) # => “Inflections” demodulize(”) # => “” “‘
See also #deconstantize.
Parameters
-
pathreq
Source
# File activesupport/lib/active_support/inflector/methods.rb, line 271
def demodulize(path)
path = path.to_s
if i = path.rindex("::")
path[(i + 2), path.length]
else
path
end
end
Defined in activesupport/lib/active_support/inflector/methods.rb line 271
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Inflector