I have a javascript object of this form
obj = "[
{
title: "Sean Kingston1",
duration: parseInt("71", 10),
},
{
title: "Sean Kingston2",
duration: parseInt("71", 10),
},
]"
is there a way to convert this to a ruby hash ?
I tried using JSON.parse and JSON.load
both of them throw
JSON::ParserError: lexical error: invalid string in json text.
{ title: "Sean Kingston1
(right here) ------^
Is there a generic solution or should I use regex and then construct the hash in ruby ?