Class: Hubkit::RepoPaginator

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

Overview

Retrieves all visible repos in one flat array, handling GitHub pagination

Instance Method Summary collapse

Methods inherited from Paginator

#each

Constructor Details

#initialize(visibility = 'all') ⇒ RepoPaginator

Construct a new repo paginator

Parameters:

  • visibility (optional String) (defaults to: 'all')

    if missing or 'all', retrieves all repos. if 'public', only retrieves public repos


9
10
11
12
13
14
15
# File 'lib/hubkit/repo_paginator.rb', line 9

def initialize(visibility='all')
  super() do |i|
    Cooldowner.with_cooldown do
      Hubkit.client.repos.list(visibility: visibility, page: i)
    end
  end
end