Skip to content

Instantly share code, notes, and snippets.

@nbfritz
Created December 14, 2012 14:58
Show Gist options
  • Select an option

  • Save nbfritz/4286016 to your computer and use it in GitHub Desktop.

Select an option

Save nbfritz/4286016 to your computer and use it in GitHub Desktop.
Ruby Hash Post - Part 1: explodey hash counter
counter = {} # => {}
counter[:monkey] += 1 # BOOM! NoMethodError: undefined method `+' for nil:NilClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment