Method: String#deconstantize
- Defined in:
- activesupport/lib/active_support/core_ext/string/inflections.rb
#deconstantize ⇒ Object
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.
177 178 179 |
# File 'activesupport/lib/active_support/core_ext/string/inflections.rb', line 177 def deconstantize ActiveSupport::Inflector.deconstantize(self) end |