Read_with_load.rb
This content was produced by an LLM and could include errors.
This script loads the JSON library and reads a local file. It then parses the JSON data, converting the file’s contents into a usable Ruby hash.
require 'json'
#=> true
JSON.load(File.read('input/json/file.json'))
#=> {"key" => "value"}
Ruby 4.0.3