Class: Ranker::Strategies::StandardCompetition

Inherits:
Strategy
  • Object
show all
Defined in:
lib/ranker/strategies/standard_competition.rb

Overview

Instance Attribute Summary

Attributes inherited from Strategy

#options, #rankables

Instance Method Summary collapse

Methods inherited from Strategy

#errors, #initialize, #rank, #rankings, #scores, #valid?

Constructor Details

This class inherits a constructor from Ranker::Strategies::Strategy

Instance Method Details

#executeObject

Methods:



10
11
12
13
14
15
16
17
# File 'lib/ranker/strategies/standard_competition.rb', line 10

def execute
  rank = 1
  scores_unique_sorted.each_with_index { |score, index|
    rankables_for_score = rankables_for_score(score)
    create_ranking(rank, score, rankables_for_score)
    rank += rankables_for_score.count
  }
end