From 9eb5a7963d90f67c81a0dc06faeed9530c25878b Mon Sep 17 00:00:00 2001 From: John Nunemaker Date: Wed, 13 Jan 2016 16:42:39 -0500 Subject: [PATCH] Switch has_key to more ruby-ish key method --- lib/httparty.rb | 2 +- lib/httparty/connection_adapter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/httparty.rb b/lib/httparty.rb index f61654b..2a9e8bc 100644 --- a/lib/httparty.rb +++ b/lib/httparty.rb @@ -543,7 +543,7 @@ module HTTParty private def ensure_method_maintained_across_redirects(options) - unless options.has_key? :maintain_method_across_redirects + unless options.key?(:maintain_method_across_redirects) options[:maintain_method_across_redirects] = true end end diff --git a/lib/httparty/connection_adapter.rb b/lib/httparty/connection_adapter.rb index aec78b7..daa6c5d 100644 --- a/lib/httparty/connection_adapter.rb +++ b/lib/httparty/connection_adapter.rb @@ -76,7 +76,7 @@ module HTTParty def connection host = clean_host(uri.host) port = uri.port || (uri.scheme == 'https' ? 443 : 80) - if options.has_key?(:http_proxyaddr) + if options.key?(:http_proxyaddr) http = Net::HTTP.new(host, port, options[:http_proxyaddr], options[:http_proxyport], options[:http_proxyuser], options[:http_proxypass]) else http = Net::HTTP.new(host, port)