class GdsApi::ContentApi

def business_support_schemes(identifiers)

def business_support_schemes(identifiers)
  identifiers = identifiers.map {|i| CGI.escape(i) }
  url_template = "#{base_url}/business_support_schemes.json?identifiers="
  response = nil # assignment necessary for variable scoping
  start_url = "#{url_template}#{identifiers.shift}"
  last_batch_url = identifiers.inject(start_url) do |url, id|
    new_url = [url, id].join(',')
    if new_url.length >= 2000
      # fetch a batch using the previous url, then return a new start URL with this id
      response = get_batch(url, response)
      "#{url_template}#{id}"
    else
      new_url
    end
  end
  get_batch(last_batch_url, response)
end