Created
October 24, 2014 09:25
-
-
Save tgautier/d61e0c05eb618c96dd4c to your computer and use it in GitHub Desktop.
[Le Wagon] JSON & Arrays
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
{ | |
"name": "Paris", | |
"population": 2211000 | |
} |
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
require "json" | |
file = File.open('file.json', 'rb') | |
json_text = file.read | |
result = JSON.parse(json_text) | |
p result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment