I am new to ruby and its nuances but I am running into this issue that I dont quite know how to fix or understand:
If I create the hash:
test = JSON.parse('[
{"values":[
["header 1", "header 2", "header 3"],
["value 1", "value 2", "value 3"]]
}]
')
Then I access test.values[0] I get:
[[["header 1", "header 2", "header 3"], ["value 1", "value 2", "value 3"]]]
As you can see it adds an extra layer onto the array. where what I would expect it to return would be:
[["header 1", "header 2", "header 3"], ["value 1", "value 2", "value 3"]]
Can anyone explain this to me or help mitigate this issue?
thanks!
.valueson an array (which is whattestis)test[0].valuesnot what you put there.