I was trying to create a hash and later on convert it into json object
a = { "event": "game",
"properties":
{
"ip": "123.123.123.123",
"token": "dejdedjjjne",
"time": 1245613885,
"action": "play"
}
}
Getting an error:-
: odd number list for Hash
and syntax error, unexpected ':', expecting '}'
Ruby’s syntax is to use
=>instead of:. In Ruby 1.9, you also have the option of retaining the colons if you omit the quotes around the keys (this also makes the key a symbol).