Symbol Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Symbol objects represent ……………….. inside the Ruby interpreter.

A

names

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is the similar method for to_sym?

A

:intern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the use of encoding method?

A

Returns the Encoding object that represents the encoding of symbol.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how to return a string from symbol?(apart from to_s)

A

id2name method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly