Method: String#deconstantize

Defined in:
lib/active_support/core_ext/string/inflections.rb

#deconstantizeObject

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.

[View source]

177
178
179
# File 'lib/active_support/core_ext/string/inflections.rb', line 177

def deconstantize
  ActiveSupport::Inflector.deconstantize(self)
end