lib/gocardless_pro/services/base_service.rb
# take a URL with placeholder params and substitute them out for the actual value
# @param url [String] the URL with placeholders in
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
take a URL with placeholder params and substitute them out for the actual value
take a URL with placeholder params and substitute them out for the actual value
def sub_url(url, param_map)
        param_map.reduce(url) do |new_url, (param, value)|
          new_url.gsub(":#{param}", CGI.escape(value))
        end
      end
def sub_url ( url , param_map ) param_map . reduce ( url ) do | new_url , ( param , value ) | new_url . gsub ( ":#{param}" , CGI . escape ( value ) ) end end
take a URL with placeholder params and substitute them out for the actual value
take a URL with placeholder params and substitute them out for the actual value
url
the URL with placeholders in
the URL with placeholders in
param_map
a hash of placeholders and their actual values (which will be escaped)
a hash of placeholders and their actual values ( which will be escaped )