module RiotLolApi::Request::Game

Public Instance Methods

current_game(summoner_id, platform_id = 'EUW1') click to toggle source
# File lib/riot_lol_api/requests/games.rb, line 10
def current_game(summoner_id, platform_id = 'EUW1')
  response = get(url: "observer-mode/rest/consumer/getSpectatorGameInfo/#{platform_id}/#{summoner_id}", domaine: @region, overide_base_uri: 'api.pvp.net/')
  return nil if response.nil?
  RiotLolApi::Model::Game.new(response.lol_symbolize)
end
match(game_id) click to toggle source
# File lib/riot_lol_api/requests/games.rb, line 16
def match(game_id)
  response = get(url: "#{@region}/v2.2/match/#{game_id}", domaine: @region)
  return nil if response.nil?
  RiotLolApi::Model::Match.new(response.lol_symbolize)
end