hash = { foo: 'bar' } hash.default = :default_value hash[:foo] #=> 'bar' hash[:inexistent] #=> :default_value