Favor format over String#% rubocop
Solution 1:
First of all, this is not about string interpolation, but about string formatting. The RuboCop Ruby style guide says:
Favor the use of
sprintf
and its aliasformat
over the fairly crypticString#%
method.
This would mean changing
request_url ||= URI_FORMATS[:home_page] % {
base_uri: AppConfig.test_api['base_url'],
end_point: AppConfig.test_api['end_points']['home_page'],
client_id: AppConfig.test_api['client_id'],
}
to
request_url ||= format(
URI_FORMATS[:home_page],
base_uri: AppConfig.test_api['base_url'],
end_point: AppConfig.test_api['end_points']['home_page'],
client_id: AppConfig.test_api['client_id'],
)