instance method
deconstantize
Ruby on Rails edge
Since v3.2.22.5Signature
deconstantize()
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 ActiveSupport::Inflector.deconstantize.
See also `demodulize`.
: () -> String
Source
# File activesupport/lib/active_support/core_ext/string/inflections.rb, line 207
def deconstantize
ActiveSupport::Inflector.deconstantize(self)
end
Defined in activesupport/lib/active_support/core_ext/string/inflections.rb line 207
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String