Class: Olympic::Rating::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/olympic/rating/base.rb

Overview

The base rating. A rating is used to describe the performance of a unit, e.g. one team. This is just an abstraction of the rating system, and as such, doesn’t actually implement the API.

Direct Known Subclasses

Glicko

Class Method Summary collapse

Class Method Details

.required_fieldsHash{Symbol => Array<(Symbol, Hash)>}

Returns a hash of the fields that are required on a Team to make it compatible with the rating system. The base API requires no fields. However, if it were to require a ‘:rating` decimal field, it would have a value of something like this:

{ rating: [:decimal, { null: false, default: 100.2 }] }

The key is the name of the field, the value are options that are passed as options to the SQL column.

Returns:

  • (Hash{Symbol => Array<(Symbol, Hash)>})


20
21
22
# File 'lib/olympic/rating/base.rb', line 20

def self.required_fields
  {}
end