fixes, documenttation and tests for game api

This commit is contained in:
danijoo
2014-01-01 18:09:25 +01:00
parent 471c9d6f71
commit f05ed4de81
4 changed files with 107 additions and 16 deletions

View File

@@ -2,12 +2,17 @@ require 'sightstone/modules/sightstone_base_module'
require 'sightstone/summoner'
require 'sightstone/match_history'
# module to access the game api
class GameModule < SightstoneBaseModule
def initialize(sightstone)
@sightstone = sightstone
end
# returns the match history of a summoner
# @param [Summoner, Fixnum] summoner summoner object or id of a summoner
# @param optional [Hash] optional arguments: :region => replaces default region
# @return [MatchHistory] match history of the summoner
def recent(summoner, optional={})
region = optional[:region] || @sightstone.region
id = if summoner.is_a? Summoner