I was looking through the ruby Kernel doc and saw this method:
a = 2
local_variables # => [:a, :_]
Why does it return :a and not a? I thought the ":" was reserved for symbols, but the symbol :a doesn't point to the variable a nor to it's assigned value, 2.
Furthermore, how would I go about accessing the actual variables through this method? As in b=local_variables.first (would be 2, but is :a).
Is there a reason behind this behavior, what is it?
Thanks/