Heads up: This description was created by AI and might not be 100% accurate.

read_with_load.rb

This Ruby code snippet demonstrates reading a JSON file named ‘file.json’ from the ‘input/json’ directory, parsing its contents using the JSON.load method, and returning the parsed JSON data as a Ruby hash with the key “key” and the value “value”.

Ruby code snippet

require 'json'
#=> true
JSON.load(File.read('input/json/file.json'))
#=> {"key" => "value"}

Executed with Ruby 3.4.5.