I have a http response from a url :
response = Net::HTTP.get(uri)
=> "[1,2,3,4,5]"
response is a string but I would like to convert it to an array like
=> [1,2,3,4,5]
So I am doing this currently :
response = response.split('[').join.split(']').join.split(',').map{|n| n.to_i}
I feel this is not the rite way, is there any better way to do it. Thanks in advance.