Module: RiotLolApi::Request::Game

Included in:
Client
Defined in:
lib/riot_lol_api/requests/games.rb

Instance Method Summary collapse

Instance Method Details

#current_game(summoner_id, platform_id = 'EUW1') ⇒ Object



10
11
12
13
14
# 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


4
5
6
7
8
# File 'lib/riot_lol_api/requests/games.rb', line 4

def featured_games
  response = get(url: 'observer-mode/rest/featured', domaine: @region, overide_base_uri: 'api.pvp.net/')
  return nil if response.nil?
  RiotLolApi::Model::Observer.new(response.lol_symbolize)
end

#match(game_id) ⇒ Object



16
17
18
19
20
# 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