Created
September 16, 2011 09:55
-
-
Save markoa/1221711 to your computer and use it in GitHub Desktop.
ruby 1.9 hash syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def do_it(options = {}) | |
puts options.inspect | |
end | |
# new syntax: | |
do_it(user_type: :vip) | |
# => {:user_type=>:vip} | |
# old syntax | |
do_it(:user_type => :vip) | |
# => {:user_type=>:vip} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment