Skip to content

Instantly share code, notes, and snippets.

@dpick
Created May 11, 2012 04:13
Show Gist options
  • Save dpick/2657486 to your computer and use it in GitHub Desktop.
Save dpick/2657486 to your computer and use it in GitHub Desktop.
1.9.2p290 :001 > a = Hash.new([])
=> {}
1.9.2p290 :002 > a[:b] << 1
=> [1]
1.9.2p290 :003 > a
=> {}
1.9.2p290 :004 > a[:b] << 2
=> [1, 2]
1.9.2p290 :005 > a
=> {}
1.9.2p290 :006 > a[:b]
=> [1, 2]
1.9.2p290 :007 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment