Class: Ranker::Strategies::Dense

Inherits:
Strategy
  • Object
show all
Defined in:
lib/ranker/strategies/dense.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
# File 'lib/ranker/strategies/dense.rb', line 10

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