Logo

Programming-Idioms

History of Idiom 91 > diff from v15 to v16

Edit summary for version 16 by :
New Ruby implementation by user [mg]

Version 15

2015-12-30, 01:14:15

Version 16

2016-02-16, 19:46:02

Idiom #91 Load JSON file into struct

Read from file data.json and write its content into object x.
Assume the JSON data is suitable for the type of x.

Idiom #91 Load JSON file into struct

Read from file data.json and write its content into object x.
Assume the JSON data is suitable for the type of x.

Imports
require 'json'
Code
x = JSON.parse(File.read('data.json'))