How do I serialize an array and deserialize it back from a string? I tried the following code, but it doesn't really return the original array of integers but does for the array of strings.
x = [1,2,3].join(',') # maybe this is not the correct way to serialize to string?
=> '1,2,3'
x = x.split(',')
=> [ '1', '2', '3' ]
Is there a way to get it back to integers without having the .collect{ |x| x.to_i }
?