fixed, documentation and update to team module
This commit is contained in:
@@ -2,11 +2,16 @@ require 'sightstone/modules/sightstone_base_module'
|
||||
require 'sightstone/summoner'
|
||||
require 'sightstone/team'
|
||||
|
||||
# module to make calls to the team api
|
||||
class TeamModule < SightstoneBaseModule
|
||||
def initialize(sightstone)
|
||||
@sightstone = sightstone
|
||||
end
|
||||
|
||||
# call to receive all teams for a summoner
|
||||
# @param [Summoner, Fixnum] summoner summoner object or id of a summoner
|
||||
# @param optional [Hash] optional arguments: :region => replaces default region
|
||||
# @ return [Array<Team>] An array containing all teams of the given summoner
|
||||
def teams(summoner, optional={})
|
||||
region = optional[:region] || @sightstone.region
|
||||
id = if summoner.is_a? Summoner
|
||||
@@ -15,7 +20,7 @@ class TeamModule < SightstoneBaseModule
|
||||
summoner
|
||||
end
|
||||
|
||||
uri = "https://prod.api.pvp.net/api/#{region}/v2.1/team/by-summoner/#{id}"
|
||||
uri = "https://prod.api.pvp.net/api/lol/#{region}/v2.2/team/by-summoner/#{id}"
|
||||
|
||||
response = _get_api_response(uri)
|
||||
_parse_response(response) { |resp|
|
||||
|
||||
Reference in New Issue
Block a user