Class: Rito::MatchHistoryOld

Inherits:
Base
  • Object
show all
Defined in:
lib/rito/match_history_old.rb

Class Method Summary collapse

Methods inherited from Base

all_regions, base_url, default_query, default_region, latest_version, parameterize

Class Method Details

.by_summoner_response(summoner_id:, region: default_region, version: latest_version, champion_ids: nil, queue_type: nil, begin_index: nil, end_index: nil) ⇒ Object


10
11
12
# File 'lib/rito/match_history_old.rb', line 10

def by_summoner_response(summoner_id:, region: default_region, version: latest_version, champion_ids: nil, queue_type: nil, begin_index: nil, end_index: nil)
	response(summoner_id: summoner_id, region: region, version: version, champion_ids: champion_ids, queue_type: queue_type, begin_index: begin_index, end_index: end_index)
end

.by_summoner_url(summoner_id:, region: default_region, version: latest_version, champion_ids: nil, queue_type: nil, begin_index: nil, end_index: nil) ⇒ Object


6
7
8
# File 'lib/rito/match_history_old.rb', line 6

def by_summoner_url(summoner_id:, region: default_region, version: latest_version, champion_ids: nil, queue_type: nil, begin_index: nil, end_index: nil)
	url(summoner_id: summoner_id, region: region, version: version, champion_ids: champion_ids, queue_type: queue_type, begin_index: begin_index, end_index: end_index)
end

.regions(version:) ⇒ Object


29
30
31
32
33
34
# File 'lib/rito/match_history_old.rb', line 29

def regions(version:)
	case version
	when '2.2'
		all_regions
	end
end

.url(summoner_id:, region:, version:, champion_ids:, queue_type:, begin_index:, end_index:) ⇒ Object


14
15
16
17
18
19
20
21
22
23
# File 'lib/rito/match_history_old.rb', line 14

def url(summoner_id:, region:, version:, champion_ids:, queue_type:, begin_index:, end_index:)
	super
	
	query = default_query
	query['championIds'] = champion_ids.join(',') unless champion_ids.nil?
	query['rankedQueues'] = queue_type unless queue_type.nil?
	query['beginIndex'] = begin_index unless begin_index.nil?
	query['endIndex'] = end_index unless end_index.nil?
	base_url(region: region) + "/api/lol/#{region}/v#{version}/matchhistory/#{summoner_id}" + parameterize(query: query)
end

.versionsObject


25
26
27
# File 'lib/rito/match_history_old.rb', line 25

def versions
	['2.2']
end