Created
August 14, 2013 13:06
-
-
Save abhishek0/6230855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raw_data = JSON.parse(response.body) | |
@data = Hash.new{|h,k| h[k]=Hash.new(&h.default_proc) } | |
raw_data.each do |u| | |
# u["id"] actually prints u itself?? | |
id = u["id"], name = u["first_name"], l = u["locality"], c = u["city"] | |
@data[id]["first_name"] = name | |
@data[id]["locality"] = l | |
@data[id]["city"] = c | |
@data[id][u["status"]] = u["count"] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is the output when I do $stderr.puts u["id"] | |
{"id"=>"c7a776a4-04e1-11e3-871b-78843c9a3bc9", "first_name"=>"Roman", "locality"=>"Kevin Vista", "city"=>"North Frederickfort", "count"=>1, "status"=>"rejected"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment