deconstantize

deconstantize()
Instance Public methods

Removes the rightmost segment from the constant expression in the string.

1
2
3
4
5
'Net::HTTP'.deconstantize   # => "Net"
'::Net::HTTP'.deconstantize # => "::Net"
'String'.deconstantize      # => ""
'::String'.deconstantize    # => ""
''.deconstantize            # => ""

See also demodulize.

doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.