Skip to content

Instantly share code, notes, and snippets.

@ananfang
Created July 25, 2012 03:32
Show Gist options
  • Save ananfang/3174208 to your computer and use it in GitHub Desktop.
Save ananfang/3174208 to your computer and use it in GitHub Desktop.
Symbols in Ruby: Symbol as Key
# 1.8.* and under
player1 = { :name => 'ananfang' }
player2 = { :name => 'fatandy' }
# 1.9.*
player1 = { name: 'ananfang' }
player2 = { name: 'fatandy' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment