Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolize all the option keys at Redis::Client#initialize(option) #958

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/redis/client.rb
Expand Up @@ -404,14 +404,13 @@ def _parse_options(options)
return options if options[:_parsed]

defaults = DEFAULTS.dup
options = options.dup
options = options.each_with_object({}) do |(key, value), new_option|
new_option[key.to_sym] = value # Dup and symbolize keys
end

defaults.keys.each do |key|
# Fill in defaults if needed
defaults[key] = defaults[key].call if defaults[key].respond_to?(:call)

# Symbolize only keys that are needed
options[key] = options[key.to_s] if options.key?(key.to_s)
end

url = options[:url]
Expand Down