Class: OctoRanker::Repository
- Inherits:
-
Object
- Object
- OctoRanker::Repository
- Defined in:
- lib/octo_ranker/repository.rb
Instance Method Summary collapse
-
#initialize(stars) ⇒ Repository
constructor
A new instance of Repository.
-
#weight ⇒ Object
Defines how heavily a repository should be counted when determining scores for a user.
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
#weight ⇒ Object
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 |