Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Symbol#inspect

sym.inspect → string

Returns the representation of sym as a symbol literal.

Example
:fred.inspect   #=> ":fred"
See also #id2name #intern #end_with? #length also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1