What should I do to marshal an hash of arrays? The following code only prints {}.
{}
s = Hash.new s.default = Array.new s[0] <<
You can just create your hash structure while initialing Hash.new to avoid such trouble
h = Hash.new{ |a,b| a[b] = [] } h[:my_key] << "my value"