constantcontact/ruby-sdk — pull request #22 by gshiftlabs-jsteel (2014-02-28 15:20:26+00:00)
Title: Allow next params to be passed in next_link format

The documentation for functions that accept a next parameter confused me a little:

next - the next link returned from a previous paginated call. May only be used by itself.

I thought this meant I could pass in { :next => previous_result_set.next }. But I actually have to parse out the next id from the previous_result_set.next url. This commit makes it so you can do the above, making it much easier to paginate through results. ie:

api = ConstantContact::Api.new(api_key)
results = api.get_contacts(access_token)
results2 = api.get_contacts(access_token, :next => results.next)