-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
This looks pretty repetitive/verbose.
Maybe could do something like:
@host ||= other_configuration.host if other_configuration.hostMight 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)
endI'd also suggest moving root_cert to an attr method like I mentioned elsewhere:
def root_cert
@root_cert ||= File.read(@root_cert_path)
endOriginally posted by @technicalpickles in #8 (comment)
Metadata
Metadata
Assignees
Labels
No labels