Skip to content

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

instance method

Symbol#id2name

id2name

Alias of #to_s

Returns a string representation of self (not including the leading colon):

Example
:foo.to_s # => "foo"

Symbol#id2name is an alias for Symbol#to_s.

Related: Symbol#inspect, Symbol#name.

See also #to_s #end_with? #inspect #encoding also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0