#!/usr/bin/ruby
#hash_of_hash.rb

list={"app1"=>101,"app2"=>104,"app3"=>109,"app4"=>123}

h=Hash.new{ |h,id| h[id]=Hash.new{ |h,dt| h[dt]={} }}
h["company"]["products"]=list
puts h

# edit this code if you've much easier format than this one.
# output should be same.

-- 
Posted via http://www.ruby-forum.com/.