class String

def deconstantize

See also +demodulize+.

See ActiveSupport::Inflector.deconstantize.

''.deconstantize # => ""
'::String'.deconstantize # => ""
'String'.deconstantize # => ""
'::Net::HTTP'.deconstantize # => "::Net"
'Net::HTTP'.deconstantize # => "Net"

Removes the rightmost segment from the constant expression in the string.
def deconstantize
  ActiveSupport::Inflector.deconstantize(self)
end