Ruby - File IO
Which of the following is the correct way to convert a Ruby hash {"name" => "Alice"} to a JSON string?
Which of the following is the correct way to convert a Ruby hash {"name" => "Alice"} to a JSON string?
JSON.generate converts Ruby objects like hashes into JSON strings.JSON.parse reads JSON strings, JSON.load is similar to parse but less common, JSON.dump also converts Ruby objects but requires a string or IO target.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions