Wednesday, 7 August 2013

Parse JSON with Ruby

Parse JSON with Ruby

I have two JSON returns.
One I am able to parse fine
{"login"=>"foo", "id"=>bar,
with
@foobar_collect["login"]
But one I am having issues with
{"items"=>[{"user_id"=>foo, "user_type"=>"bar",
I try
@foobar_collect["items"]["user_id"]
And it gives me an error no implicit conversion of String into Integer
What am I doing wrong?

No comments:

Post a Comment