Class: RiotGamesApi::LOL::Resource::StaticData

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

Instance Method Summary collapse

Constructor Details

#initialize(connection, region) ⇒ StaticData

Returns a new instance of StaticData.



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

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

Instance Method Details

#champion_all(key_by_id = false, data_version = nil) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 10

def champion_all(key_by_id = false, data_version = nil)
  champion_list = get(resource_path('champion'), @version, champData: 'all', dataById: key_by_id, version: data_version)

  if key_by_id
    RiotGamesApi::LOL::Model::StaticData::ChampionListDataById.new champion_list
  else
    RiotGamesApi::LOL::Model::StaticData::ChampionList.new champion_list
  end
end

#champion_by_id(champion_id, data_version = nil) ⇒ Object



20
21
22
23
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 20

def champion_by_id(champion_id, data_version = nil)
  champion = get(resource_path('champion', champion_id), @version, champData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::Champion.new champion
end

#item_all(data_version = nil) ⇒ Object



25
26
27
28
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 25

def item_all(data_version = nil)
  item_list = get(resource_path('item'), @version, itemListData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::ItemList.new item_list
end

#item_by_id(item_id, data_version = nil) ⇒ Object



30
31
32
33
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 30

def item_by_id(item_id, data_version = nil)
  item = get(resource_path('item', item_id), @version, itemData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::Item.new item
end

#mastery_all(data_version = nil) ⇒ Object



35
36
37
38
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 35

def mastery_all(data_version = nil)
  mastery_list = get(resource_path('mastery'), @version, masteryListData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::MasteryList.new mastery_list
end

#mastery_by_id(mastery_id, data_version = nil) ⇒ Object



40
41
42
43
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 40

def mastery_by_id(mastery_id, data_version = nil)
  mastery = get(resource_path('mastery', mastery_id), @version, masteryData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::Mastery.new mastery
end

#realmObject



45
46
47
48
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 45

def realm
  realm = get(resource_path('realm'), @version)
  RiotGamesApi::LOL::Model::StaticData::Realm.new realm
end

#rune_all(data_version = nil) ⇒ Object



50
51
52
53
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 50

def rune_all(data_version = nil)
  rune_list = get(resource_path('rune'), @version, runeListData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::RuneList.new rune_list
end

#rune_by_id(rune_id, data_version = nil) ⇒ Object



55
56
57
58
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 55

def rune_by_id(rune_id, data_version = nil)
  rune = get(resource_path('rune', rune_id), @version, runeData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::Rune.new rune
end

#summoner_spell_all(key_by_id = false, data_version = nil) ⇒ Object



60
61
62
63
64
65
66
67
68
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 60

def summoner_spell_all(key_by_id = false, data_version = nil)
  summoner_spell_list = get(resource_path('summoner-spell'), @version, spellData: 'all', dataById: key_by_id, version: data_version)

  if key_by_id
    RiotGamesApi::LOL::Model::StaticData::SummonerSpellListDataById.new summoner_spell_list
  else
    RiotGamesApi::LOL::Model::StaticData::SummonerSpellList.new summoner_spell_list
  end
end

#summoner_spell_by_id(summoner_spell_id, data_version = nil) ⇒ Object



70
71
72
73
# File 'lib/riot_games_api/lol/resource/static_data.rb', line 70

def summoner_spell_by_id(summoner_spell_id, data_version = nil)
  summoner_spell = get(resource_path('summoner-spell', summoner_spell_id), @version, spellData: 'all', version: data_version)
  RiotGamesApi::LOL::Model::StaticData::SummonerSpell.new summoner_spell
end