Check out the ruby documentation for Hash
new โ new_hash click to switch the source
new (obj) โ new_hash
new {| hash key | block} โ new_hash
. , -, , . nil. obj , . , - . , .
# While this creates a new default object each time
h = Hash.new { |hash, key| hash[key] = "Go Fish: #{key}" }
h["c"] #=> "Go Fish: c"
h["c"].upcase! #=> "GO FISH: C"
h["d"] #=> "Go Fish: d"
h.keys #=> ["c", "d"]