Skip to content

Instantly share code, notes, and snippets.

@flaneur2020
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save flaneur2020/9183545 to your computer and use it in GitHub Desktop.

Select an option

Save flaneur2020/9183545 to your computer and use it in GitHub Desktop.
2.0.0-p247 :001 > h = Hash.new([])
=> {}
2.0.0-p247 :002 > h[:a] << 1
=> [1]
2.0.0-p247 :003 > h
=> {}
2.0.0-p247 :004 > h[:a]
=> [1]
2.0.0-p247 :005 > h
=> {}
2.0.0-p247 :006 > h[:a] += [2]
=> [1, 2]
2.0.0-p247 :007 > h
=> {:a=>[1, 2]}
2.0.0-p247 :008 > h[:b]
=> [1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment