instance method
deconstantize
Ruby on Rails 3.2.22.5
Since v3.2.22.5Signature
deconstantize(path)
Removes the rightmost segment from the constant expression in the string:
"Net::HTTP".deconstantize # => "Net" "::Net::HTTP".deconstantize # => "::Net" "String".deconstantize # => "" "::String".deconstantize # => "" "".deconstantize # => ""
See also demodulize.
Parameters
-
pathreq
Source
# File activesupport/lib/active_support/inflector/methods.rb, line 177
def deconstantize(path)
path.to_s[0...(path.rindex('::') || 0)] # implementation based on the one in facets' Module#spacename
end
Defined in activesupport/lib/active_support/inflector/methods.rb line 177
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Inflector