I'm looking for a way to increment the values of keys foo and bar
{
"users": [
{
"foo": 6522
},
{
"bar": 20
}
]
}
Here is an example of what I attempted, however the result leaves the values unchanged.
data = JSON.parse(filepath\info.json)
puts data["users"][1].values[0] # 20
data["users"][1].values[0] += 5
puts data["users"][1].values[0] # remains 20, but expected 25
Is there another way to increment these values?