method

deconstantize

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: String
deconstantize() public

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.

Show source
Register or log in to add new notes.