diff options
Diffstat (limited to 'lib/sampling/README.md')
-rw-r--r-- | lib/sampling/README.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/sampling/README.md b/lib/sampling/README.md new file mode 100644 index 0000000..e4b3fbf --- /dev/null +++ b/lib/sampling/README.md @@ -0,0 +1,50 @@ +Sampling interface +================== + +Files in this directory should be _classes_ implementing the following +interface: + + - `self.works_with?(Game) => Boolean` + + Returns whether or not this sampling method works with the + specified game. + + - `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. + + - `self.uses_remote?() => Boolean` + + Return whether or not this sampling method requires remote IDs for + users. + + - `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. + + - `self.get_remote_name(Object)` + + When given an object from `RemoteUsername#value`, give back a + human-readable/editable name to display + +---- + + - `initialize(Match)` + + Construct new Sampling object for the specified match. + + - `start()` + + Begin fetching the statistics. + + - `render_user_interaction(User) => String` + + Returns HTML to render on a page. + + - `handle_user_interaction(User, Hash params)` + + Handles params from the form generated by + `#user_interaction_render`. |