Essentially, taking a string that would look something like this:
input_test = "
test1 = hello
test2 = goodbye
"
Is there a way with ruby to convert the string to be a json object?
input_test.convert_method()
puts input_test['test2'] #outputs 'goodbye'
Aucun commentaire:
Enregistrer un commentaire