Weirdly, I was about to tackle this exact problem. === fails:
ruby-1.9.2-p0 > {"1"=>{"foo"=>1}} === Hash
=> false
so I did this, which works great:
recursive_merge = lambda{|k, old, new| new.is_a?(Hash) && old.is_a?
(Hash) ? new.merge(old, &recursive_merge) : new}}
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
