Print out a nested hash : Print Hash « Hash « Ruby
- Ruby
- Hash
- Print Hash
Print out a nested hash
require 'pp'
h = {}
h[:name] = "Robert"
h[:nickname] = "Bob"
h[:age] = 43
h[:email_addresses] = {:home => "[email protected]",
:work => "[email protected]"}
PP::pp(h, $stderr, 50)
Related examples in the same category