class FavLanguage::RepoList

Attributes

github[R]
username[R]

Public Class Methods

new(github:, username:) click to toggle source
# File lib/fav_language/repo_list.rb, line 7
def initialize(github:, username:)
  @github = github
  @username = username
end

Public Instance Methods

fetch() click to toggle source
# File lib/fav_language/repo_list.rb, line 12
def fetch
  @repos ||= github.repos
              .list(user: username, auto_pagination: true)
              .reject{ |r| r["fork"] }
              .map{ |r| Repo.new(r, github: github) }
end
language_stats() click to toggle source
# File lib/fav_language/repo_list.rb, line 19
def language_stats
  fetch.flat_map do |repo|
    repo.language_stats
  end
end