Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Supporting pagination #84

Open
raldred opened this issue Feb 5, 2019 · 1 comment
Open

Supporting pagination #84

raldred opened this issue Feb 5, 2019 · 1 comment

Comments

@raldred
Copy link

raldred commented Feb 5, 2019

I'm considering adding support for pagination.
Due to the way the response is parsed and returned as part of the make_request to all the resource methods, there is no way to access the Link or X-Total-Count headers returned by onfido.

I would like to do this work and was considering adding an Onfido::Response class which is returned by make_request and in turn by the individual resources.

The class would be responsible for parsing the response from RestClient and exposing the various headers in the initial stages to at least give visibility over the total count to aid pagination, with a view to adding more complete pagination support later.

Something really bare bones would at least give access to the headers

class Onfido::Response
  def initialize(response, request_options)
    @results = parse(response)
    @headers = response.headers
  end
  
  attr_reader :results
  attr_reader :headers

  def total_count
     @headers[:x_total_count]
  end
end

Has there been any work done so far?
Thoughts?

@hjheath
Copy link
Collaborator

hjheath commented Jan 13, 2020

Hi @raldred we are moving this project to https://github.com/onfido/onfido-ruby for future updates. Please feel free to raise this issue there and we will take a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants