module Toolbox::Json
Extends the functionality of String
to support pretty_printing json. This is really a natural extension of the basic String
type to support JSON.pretty_generate(string).
Usage¶ ↑
puts %w{ foo bar hello world }.to_json_pp puts [{:hello => 'world',:find => 'waldo'}].to_json_pp puts {:foo => 'bar', :hello => 'world'}.to_json_pp puts {:foo => 'bar', :hello => ['world']}.to_json_pp