No. A symbol is equal to its string representation, but there are no other hidden meanings or transformations. This is exactly like '2' != 2 != :'2'
, despite in this case you can apply some casting using to_i
.
You could actually use the symbol representation of a comma, but I'm not sure it makes the code more readable.
2.0.0-p353 :011 > var = :','
=> :","
2.0.0-p353 :012 > var.class
=> Symbol
2.0.0-p353 :013 > var.to_s
=> ","