public
Last active

  • Download Gist
keys.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.