summaryrefslogtreecommitdiff
path: root/lib/sampling/README.md
blob: bde84cdfa61e85dcd2970092a342b8133280144b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Sampling interface
==================

Files in this directory should be _modules_ implementing the following
interface:

 - `works_with?(Game) => Boolean`

   Returns whether or not this sampling method works with the
   specified game.

 - `can_get?(User, String setting_name) => Fixnum`

   Returns whether or nat this sampling method can get a specifed
   statistic; 0 means 'false', positive integers mean 'true', where
   higher numbers are higher priority.

 - `uses_remote?() => Boolean`

   Return whether or not this sampling method requires remote IDs for
   users.
 - `set_remote_name(User, Game, String)`

   Set the remote ID for a user for the specified game.  It is safe to
   assume that this sampling method `works_with?` that game.
 - `get_remote_name(Object)`

   When given an object from `RemoteUsername#value`, give back a
   human-readable/editable name to display.

 - `sampling_start(Match, Array[]={:user=>User,:stat=>String})`

   Fetch the statistics for a match.

 - `render_user_interaction(Match, User) => String`

   Returns HTML to render on a page.

 - `handle_user_interaction(Match, User, Hash params)`

   Handles params from the form generated by
   `#user_interaction_render`.