How to Parse Json in Ruby

Thu, Sep 10, 2015

Read in 1 minutes

In Ruby you parse json by first including the json library (either the one provided with the language - or any one of the gems that provide the same functionality)

require 'json'
data = JSON.parse('{"name":"Claus Witt","ideas":["idea one", "idea two"]}')
puts data['name']

See Also

How to Write Json in Ruby

Fri, Sep 11, 2015

Read more →

How to Parse Json in JavaScript

Tue, Sep 8, 2015

Read more →

How to Read from stdin in Ruby

Fri, Aug 28, 2015

Read more →

How to Write a TCP Echo Server in Ruby

Mon, Aug 24, 2015

Read more →

How to Write Xml in Ruby

Mon, Aug 17, 2015

Read more →