hash = Hash.new(:default_value) hash[:foo] = 'bar' hash[:foo] #=> 'bar' hash[:inexistent] #=> :default_value