Mega Code Archive

 
Categories / Ruby / Hash
 

Use new to create a hash with a default value which is otherwise just nil

months = Hash.new( "month" ) # or like this: months = Hash.new "month"