Class: OctoRanker::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/octo_ranker/repository.rb

Instance Method Summary collapse

Constructor Details

#initialize(stars) ⇒ Repository

Returns a new instance of Repository.



3
4
5
# File 'lib/octo_ranker/repository.rb', line 3

def initialize(stars)
  @stars = stars
end

Instance Method Details

#weightObject

Defines how heavily a repository should be counted when determining scores for a user. Currently defined to be the number of stars on the repository (plus 1, because users should still get points for contributing, even if the repo has no stars).



11
12
13
# File 'lib/octo_ranker/repository.rb', line 11

def weight
  @stars + 1
end