Module: Ranker
- Defined in:
- lib/ranker.rb,
lib/ranker/error.rb,
lib/ranker/ranking.rb,
lib/ranker/version.rb,
lib/ranker/rankings.rb
Overview
Ranks are based on: en.wikipedia.org/wiki/Ranking
Defined Under Namespace
Modules: Strategies Classes: Error, Ranking, Rankings
Constant Summary collapse
- VERSION =
'1.1.4'
Class Method Summary collapse
-
.rank(rankables, *args) ⇒ Object
Methods:.
-
.strategies ⇒ Object
Properties:.
Class Method Details
.rank(rankables, *args) ⇒ Object
Methods:
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ranker.rb', line 27 def rank(rankables, *args) = args.pop if && .kind_of?(Hash) = .merge() else = end strategy = get_strategy(rankables, ) strategy.rank end |
.strategies ⇒ Object
Properties:
16 17 18 19 20 21 22 23 |
# File 'lib/ranker.rb', line 16 def strategies @strategies ||= { :standard_competition => Ranker::Strategies::StandardCompetition, :modified_competition => Ranker::Strategies::ModifiedCompetition, :dense => Ranker::Strategies::Dense, :ordinal => Ranker::Strategies::Ordinal } end |