Skip to content

Instantly share code, notes, and snippets.

@danmayer
Created July 29, 2009 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmayer/157782 to your computer and use it in GitHub Desktop.
Save danmayer/157782 to your computer and use it in GitHub Desktop.
### in response to http://drawohara.com/post/151193800/ruby-symbol-to-hash
#I think that isn't quite what I am talking about...
#I want
this = 5
that = 6
foo = "bar"
long_stupid_variable_name = "I love Python ;)"
hash_real = {:this => this, :that => that, :foo => foo, :long_stupid_variable_name => long_stupid_variable_name}
#to be like this, (not valid)
hash_awesome = {:this <==, :that <==, :foo <==, :long_stupid_variable_name <==}
#and have them be equivalent...
puts hash_real == hash_awesome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment