Skip to content

Instantly share code, notes, and snippets.

@bricker
Last active December 25, 2015 12:49
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 bricker/6979707 to your computer and use it in GitHub Desktop.
Save bricker/6979707 to your computer and use it in GitHub Desktop.
puts RUBY_VERSION
# "2.0.0"
def parameters(params={}, content_type: "text/html")
puts params
puts content_type
end
parameters({ query: "Ruby" })
# ArgumentError: unknown keyword: query
parameters({ query: "Ruby" }, { content_type: "application/json" })
# {:query=>"Ruby"}
# application/json
parameters({ query: "Ruby" }, {})
# {:query=>"Ruby"}
# text/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment