class OctoRanker::User

Attributes

login[W]
score[R]

Public Class Methods

new(login = nil) click to toggle source
# File lib/octo_ranker/user.rb, line 6
def initialize(login = nil)
  @login, @score = login, 0
end

Public Instance Methods

add_repo(commits, repo) click to toggle source

Add the score for repo to the score for this user. Currently, the score for a repo is defined as the product of the number of commits the user has on the repo and the weight of that repo. See OctoRanker::Repository for how the weight is defined.

# File lib/octo_ranker/user.rb, line 15
def add_repo(commits, repo)
  @score += commits * repo.weight
end