Class: RiotGamesApi::LOL::Resource::Stats

Inherits:
Base
  • Object
show all
Defined in:
lib/riot_games_api/lol/resource/stats.rb

Instance Method Summary (collapse)

Constructor Details

- (Stats) initialize(connection, region)

Returns a new instance of Stats



5
6
7
8
# File 'lib/riot_games_api/lol/resource/stats.rb', line 5

def initialize(connection, region)
  super
  @version = 'v1.3'
end

Instance Method Details

- (Object) ranked(summoner_id, season = nil)

Return ranked stats data by summoner id

Parameters:

  • summoner_id (String, Integer)
  • season (String) (defaults to: nil)

    (SEASON3, SEASON2014, SEASON2015) return current if do not set

Returns:

  • RankedStats



14
15
16
17
# File 'lib/riot_games_api/lol/resource/stats.rb', line 14

def ranked(summoner_id, season = nil)
  stats = get(resource_path('ranked', summoner_id), @version, season: season)
  RiotGamesApi::LOL::Model::Stats::RankedStats.new stats
end

- (Object) summary(summoner_id, season = nil)

Return summary stats data by summoner id

Parameters:

  • summoner_id (String, Integer)
  • season (String) (defaults to: nil)

    (SEASON3, SEASON2014, SEASON2015) return current if do not set

Returns:

  • PlayerStatsSummaryList



23
24
25
26
# File 'lib/riot_games_api/lol/resource/stats.rb', line 23

def summary(summoner_id, season = nil)
  stats = get(resource_path('summary', summoner_id), @version, season: season)
  RiotGamesApi::LOL::Model::Stats::PlayerStatsSummaryList.new stats
end