Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created December 13, 2009 02:53
Show Gist options
  • Save vangberg/255227 to your computer and use it in GitHub Desktop.
Save vangberg/255227 to your computer and use it in GitHub Desktop.
>> h = Hash.new([])
=> {}
>> h[:foo] = "some value"
=> "some value"
>> h[:bar]
=> []
>> h[:bar] << "an item"
=> ["an item"]
>> h
=> {:foo=>"some value"}
>> h.keys
=> [:foo]
>> h[:bar]
=> ["an item"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment