mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
Make use of Hash#fetch.
This commit is contained in:
parent
8649485f53
commit
787a0edbb9
2 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue