Created
November 22, 2016 12:05
-
-
Save bougyman/558546abe65396ab6bee0fbd2f85131c 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
% pry | |
[1] pry(main)> require 'json' | |
=> true | |
[2] pry(main)> s = '{"version":"1.0.0","key":"epp-2026115917862253","time":"1479815894288","attributes":{"type":["epp_response_time_login","epp_response_time_hello","epp_response_time_info","epp_response_time_logout","epp_response_time_total"],"database":"DB"},"value":["0.060","0.442","0.294","0.005","0.801"],"host":"test.cc"}' | |
=> "{\"version\":\"1.0.0\",\"key\":\"epp-2026115917862253\",\"time\":\"1479815894288\",\"attributes\":{\"type\":[\"epp_response_time_login\",\"epp_response_time_hello\",\"epp_response_time_info\",\"epp_response_time_logout\",\"epp_response_time_total\"],\"database\":\"DB\"},\"value\":[\"0.060\",\"0.442\",\"0.294\",\"0.005\",\"0.801\"],\"host\":\"test.cc\"}" | |
[3] pry(main)> JSON.parse s | |
=> {"version"=>"1.0.0", | |
"key"=>"epp-2026115917862253", | |
"time"=>"1479815894288", | |
"attributes"=>{"type"=>["epp_response_time_login", "epp_response_time_hello", "epp_response_time_info", "epp_response_time_logout", "epp_response_time_total"], "database"=>"DB"}, | |
"value"=>["0.060", "0.442", "0.294", "0.005", "0.801"], | |
"host"=>"test.cc"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment