Class: Hubkit::IssuePaginator

Inherits:
Paginator show all
Includes:
Enumerable
Defined in:
lib/hubkit/issue_paginator.rb

Overview

Returns the list of issues for a repo, handling pagination for you

Instance Method Summary collapse

Methods inherited from Paginator

#each

Constructor Details

#initialize(org:, repo:, state: 'open') ⇒ IssuePaginator

Initialize a new paginator for issues from the API


13
14
15
16
17
18
19
20
21
# File 'lib/hubkit/issue_paginator.rb', line 13

def initialize(org:, repo:, state: 'open')
  @org = org
  @repo = repo
  super() do |i|
    Cooldowner.with_cooldown do
      Github.issues.list(user: @org, repo: @repo, state: state, page: i)
    end
  end
end