Skip to content

Instantly share code, notes, and snippets.

@markoa
Created September 16, 2011 09:55
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 markoa/1221711 to your computer and use it in GitHub Desktop.
Save markoa/1221711 to your computer and use it in GitHub Desktop.
ruby 1.9 hash syntax
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