We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This looks pretty repetitive/verbose.
Maybe could do something like:
@host ||= other_configuration.host if other_configuration.host
Might also be able to do this in a loop with some metaprogramming.
[:host, :port, :tls, :unix_socket_path, :root_cert_path].each do |attribute| value = instance_variable_get("@#{attribute}") other_value = other_configuration.send(attribute) instance_variable_set("@#{attribute}", value || other_value) end
I'd also suggest moving root_cert to an attr method like I mentioned elsewhere:
root_cert
def root_cert @root_cert ||= File.read(@root_cert_path) end
Originally posted by @technicalpickles in #8 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Maybe could do something like:
Might also be able to do this in a loop with some metaprogramming.
I'd also suggest moving
root_cert
to an attr method like I mentioned elsewhere:Originally posted by @technicalpickles in #8 (comment)
The text was updated successfully, but these errors were encountered: