cybo
September 15th, 2009, 04:43 AM
i'm trying to understand what they (ruby symbols) mean but i'm still confused. other languages call it string interning. i have programmed before but as it turns out i didn't program much. can someone explain what is the purpose of ruby symbols and how do they work?
here is an example from the book:
:Object
:my_variable
:"Ruby rules"
a = 'cat'
:'catsup' --> :catsup
:'#{a}sup' --> :catsup
:'#{a}sup' --> :"\#{a}sup"
any help is appreciated.
here is an example from the book:
:Object
:my_variable
:"Ruby rules"
a = 'cat'
:'catsup' --> :catsup
:'#{a}sup' --> :catsup
:'#{a}sup' --> :"\#{a}sup"
any help is appreciated.