summaryrefslogtreecommitdiff
path: root/lib/sampling/README.md
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-04-28 00:35:54 -0400
committerguntasgrewal <guntasgrewal@gmail.com>2014-04-28 00:35:54 -0400
commitfa8ec3d1e21de1456af74d411117a1b9d5e0bbc0 (patch)
treedb39868fb318275947ea4e419295bdcf47978a8c /lib/sampling/README.md
parentfbd258986b41b96a9f901d6be03bcfa9111fe13d (diff)
parent0a5242c3a460d0b99be0adc4593774a58b68154a (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'lib/sampling/README.md')
-rw-r--r--lib/sampling/README.md30
1 files changed, 19 insertions, 11 deletions
diff --git a/lib/sampling/README.md b/lib/sampling/README.md
index 3d564da..e4b3fbf 100644
--- a/lib/sampling/README.md
+++ b/lib/sampling/README.md
@@ -1,42 +1,50 @@
Sampling interface
==================
-Files in this directory should be _modules_ implementing the following
+Files in this directory should be _classes_ implementing the following
interface:
- - `works_with?(Game) => Boolean`
+ - `self.works_with?(Game) => Boolean`
Returns whether or not this sampling method works with the
specified game.
- - `can_get?(User, String setting_name) => Fixnum`
+ - `self.can_get?(String setting_name) => Fixnum`
Returns whether or not this sampling method can get a specifed
statistic; 0 means 'false', positive integers mean 'true', where
higher numbers are higher priority.
- - `uses_remote?() => Boolean`
+ - `self.uses_remote?() => Boolean`
Return whether or not this sampling method requires remote IDs for
users.
- - `set_remote_name(User, Game, String)`
+
+ - `self.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)`
+
+ - `self.get_remote_name(Object)`
When given an object from `RemoteUsername#value`, give back a
- human-readable/editable name to display.
+ human-readable/editable name to display
+
+----
+
+ - `initialize(Match)`
+
+ Construct new Sampling object for the specified match.
- - `sampling_start(Match, Array[]={:user=>User,:stat=>String})`
+ - `start()`
- Fetch the statistics for a match.
+ Begin fetching the statistics.
- - `render_user_interaction(Match, User) => String`
+ - `render_user_interaction(User) => String`
Returns HTML to render on a page.
- - `handle_user_interaction(Match, User, Hash params)`
+ - `handle_user_interaction(User, Hash params)`
Handles params from the form generated by
`#user_interaction_render`.