Class: Prawntocat::Issues

Inherits:
Object
  • Object
show all
Defined in:
lib/prawntocat/issues.rb

Instance Method Summary collapse

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

#clientObject



11
12
13
# File 'lib/prawntocat/issues.rb', line 11

def client
  @client ||= Prawntocat.client
end

#eachObject



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