Class: Glicko2::Util
- Inherits:
-
Object
- Object
- Glicko2::Util
- Defined in:
- lib/glicko2.rb
Overview
Collection of helper methods
Class Method Summary collapse
-
.ranks_to_score(rank, other) ⇒ Numeric
Convert from a rank, where lower numbers win against higher numbers, into Glicko scores where wins are ‘1`, draws are `0.5` and losses are `0`.
Class Method Details
.ranks_to_score(rank, other) ⇒ Numeric
Convert from a rank, where lower numbers win against higher numbers, into Glicko scores where wins are ‘1`, draws are `0.5` and losses are `0`.
18 19 20 21 22 23 24 25 26 |
# File 'lib/glicko2.rb', line 18 def self.ranks_to_score(rank, other) if rank < other 1.0 elsif rank == other 0.5 else 0.0 end end |