huboard / ghee

This is an unofficial ruby client for the Github API. The end goal is a complete, simple, and intuitive ruby API for all things Github.
http://documentup.com/huboard/ghee
MIT License
160 stars 51 forks source link

Paging support #2

Closed rauhryan closed 12 years ago

rauhryan commented 12 years ago

I've started thinking about paging support, particularly with issues

I'd like to open some discussion on how this might be implemented.

i've got a few options in mind,

  1. passing an options hash

    gh.repos("rauhryan","ghee").issues :page => 2, :per_page => 100
  2. capture args in a block

    gh.repos("rauhryan", "ghee").issues do |opt|
       opt[:page] = 2
       opt[:per_page] = 100
    end

i feel like option two is more flexible. Maybe theres a way to expose the faraday connection to the block then you would be free to change headers, params, whatever

jonmagic commented 12 years ago

Number 1 is what I had been toying with in my head. 2 may be more functional in the long run but just doesn't have the same beauty.

rauhryan commented 12 years ago

refer to issue #3