jonmagic/ghee — pull request #3 by rauhryan (2012-01-18 03:53:36+00:00)
Title: Pagination

Here is an early example of pagination support

im thinking that we hang #paginate off of the resource_proxy

examples:

gh.user.repos.paginate :page => 1, :per_page => 100 #=> [] of repos

that way we can hang paging information off of the proxy as well

gh.user.repos.paginate(:page => 1).current_page #=> 1
gh.user.repos.paginate(:page => 1).next_page #=> 2
gh.user.repos.paginate(:page => 1).last_page #=> 5
gh.user.repos.paginate(:page => 1).total #=> 122

Next phase we have an #all method that will loop through all the pages and give you return all the pages in one array

gh.user.repos.all.size() #=> 122

Opening up this pull request for some feedback while I work on it. Definitely not ready to pull in yet