M
Marcel Molina Jr.
I observed this odd behavior when setting a hash to have as its default
value another hash which itself has a default value set:
?
marcel
value another hash which itself has a default value set:
=> []hash_in_hash = Hash.new(Hash.new([])) => {}
hash_in_hash[:a][:b] << :incognito => [:incognito]
hash_in_hash => {}
hash_in_hash[:a] => {}
hash_in_hash.keys => []
hash_in_hash[:a][:b] => [:incognito]
hash_in_hash[:a].keys
?
marcel