Ruby's sym.to_i 1
Give this a look:
>> :"5".to_i
=> 148447
>> :"5".to_s.to_i
=> 5Ruby-Doc.org: sym.to_i returns an integer that is unique for each symbol within a particular execution of a program.
Makes sense, sure. But damn was it painful to figure that one out the hard way.
For more fun with Symbols I suggest What is a ruby symbol? – symbols explained.
Comments
-
That must have been infuriatingly frustrating to debug. I've never done this but now I'll be prepared!