Class: Prawntocat::Issues
- Inherits:
-
Object
- Object
- Prawntocat::Issues
- Defined in:
- lib/prawntocat/issues.rb
Instance Method Summary collapse
- #client ⇒ Object
- #each ⇒ Object
-
#initialize(repo) ⇒ Issues
constructor
A new instance of Issues.
Constructor Details
#initialize(repo) ⇒ Issues
Returns a new instance of Issues.
7 8 9 |
# File 'lib/prawntocat/issues.rb', line 7 def initialize repo @repo = repo end |
Instance Method Details
#client ⇒ Object
11 12 13 |
# File 'lib/prawntocat/issues.rb', line 11 def client @client ||= Prawntocat.client end |
#each ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/prawntocat/issues.rb', line 15 def each page = 1 loop do issues = client.list_issues(@repo, page: page) break if issues.empty? page += 1 issues.each { |hash| yield hash } end end |