Symbol Flashcards
1
Q
Symbol objects represent ……………….. inside the Ruby interpreter.
A
names
2
Q
if a symbol (say :ruby) is a constant in one context, a method in another, and a class in a third, that :ruby will be the same object in all three contexts. True or false?
A
True
3
Q
what is the similar method for to_sym?
A
:intern
4
Q
What is the use of encoding method?
A
Returns the Encoding object that represents the encoding of symbol.
5
Q
how to return a string from symbol?(apart from to_s)
A
id2name method