RIP
Tutorial
Tags
Topics
Examples
eBooks
Tutorial by Examples
Hash to JSON
require 'json' data = {"test" => 123} puts JSON.generate(data)
JSON to Hash
require 'json' document = "{\"test\":123}" puts JSON.parse(document)
Alternate JSON to Hash
require 'json' data = JSON '{"test":23}' # => {"test"=>23} or require 'json' data = JSON['{"test":23}'] # => {"test"=>23}
Alternate Hash to JSON
require 'json' document = JSON 'test' => 23 # => "{\"test\":23}" or require 'json' document = JSON['test' => 23] # => "{\"test\":23}"
Page 1 of 1
1
Cookie
This website stores cookies on your computer.
We use cookies to enhance your experience on our website and deliver personalized content.
For more details on our cookie usage, please review our
Cookie Policy
and
Privacy Policy
Accept all Cookies
Leave this website