diff --git a/lib/http/cookie_jar/abstract_saver.rb b/lib/http/cookie_jar/abstract_saver.rb index 766cc03..71f410a 100644 --- a/lib/http/cookie_jar/abstract_saver.rb +++ b/lib/http/cookie_jar/abstract_saver.rb @@ -37,7 +37,7 @@ class HTTP::CookieJar::AbstractSaver # Initializes each instance variable of the same name as option # keyword. default_options.each_pair { |key, default| - instance_variable_set("@#{key}", options.key?(key) ? options[key] : default) + instance_variable_set("@#{key}", options.fetch(key, default)) } end diff --git a/lib/http/cookie_jar/abstract_store.rb b/lib/http/cookie_jar/abstract_store.rb index 0f45690..395cad9 100644 --- a/lib/http/cookie_jar/abstract_store.rb +++ b/lib/http/cookie_jar/abstract_store.rb @@ -41,7 +41,7 @@ class HTTP::CookieJar::AbstractStore # Initializes each instance variable of the same name as option # keyword. default_options.each_pair { |key, default| - instance_variable_set("@#{key}", options.key?(key) ? options[key] : default) + instance_variable_set("@#{key}", options.fetch(key, default)) } end