class RiotGamesApi::LOL::Resource::StaticData

Public Class Methods

new(connection, region) click to toggle source
Calls superclass method RiotGamesApi::LOL::Resource::Base::new
# File lib/riot_games_api/lol/resource/static_data.rb, line 5
def initialize(connection, region)
  super
  @version = 'v1.2'
end

Public Instance Methods

champion_all(key_by_id = false, data_version = nil) click to toggle source

Return all champion static data @param [Boolean] key_by_id Set true if you want data hash key is ID, not name. @param [String] data_version @return [ChampionList]

# File lib/riot_games_api/lol/resource/static_data.rb, line 14
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) click to toggle source

Return a champion static data by id @param [String, Integer] champion_id @param [String] data_version @return [Champion]

# File lib/riot_games_api/lol/resource/static_data.rb, line 28
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) click to toggle source

Return all item static data @param [String] data_version @return [ItemList]

# File lib/riot_games_api/lol/resource/static_data.rb, line 36
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
language_strings(data_version = nil) click to toggle source

Return launguage strings static data @param [String] data_version @return [LanguageString]

# File lib/riot_games_api/lol/resource/static_data.rb, line 44
def language_strings(data_version = nil)
  language_string = get(resource_path('language-strings'), @version, version: data_version)
  RiotGamesApi::LOL::Model::StaticData::LanguageString.new language_string
end
languages() click to toggle source

Return launguage list @return Array language list

# File lib/riot_games_api/lol/resource/static_data.rb, line 51
def languages
  get(resource_path('languages'), @version)
end
map(data_version = nil) click to toggle source

Return all map static data by id @param [String] data_version @return [Map]

# File lib/riot_games_api/lol/resource/static_data.rb, line 58
def map(data_version = nil)
  map = get(resource_path('map'), @version, version: data_version)
  RiotGamesApi::LOL::Model::StaticData::Map.new map
end
mastery_all(data_version = nil) click to toggle source

Return all mastery static data @param [String] data_version @return [MateryList]

# File lib/riot_games_api/lol/resource/static_data.rb, line 66
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) click to toggle source

Return a mastery static data by id @param [String, Integer] mastery_id @param [String] data_version @return [Mastery]

# File lib/riot_games_api/lol/resource/static_data.rb, line 75
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
realm() click to toggle source

Return realm static data by id @return [Realm]

# File lib/riot_games_api/lol/resource/static_data.rb, line 82
def realm
  realm = get(resource_path('realm'), @version)
  RiotGamesApi::LOL::Model::StaticData::Realm.new realm
end
rune_all(data_version = nil) click to toggle source

Return all rune static data by id @param [String] data_version @return [RuneList]

# File lib/riot_games_api/lol/resource/static_data.rb, line 90
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) click to toggle source

Return a rune static data by id @param [String, Integer] rune_id @param [String] data_version @return [SummonerSpellList]

# File lib/riot_games_api/lol/resource/static_data.rb, line 99
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) click to toggle source

Return all summoner spell static data by id @param [String] data_version @return [Rune]

# File lib/riot_games_api/lol/resource/static_data.rb, line 107
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) click to toggle source

Return a summoner spell static data by id @param [String, Integer] summoner_spell_id @param [String] data_version @return [SummonerSpell]

# File lib/riot_games_api/lol/resource/static_data.rb, line 121
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
versions() click to toggle source

Return version list @return Array version list

# File lib/riot_games_api/lol/resource/static_data.rb, line 128
def versions
  get(resource_path('versions'), @version)
end

Private Instance Methods

api_endpoint(resource_path, api_version) click to toggle source
# File lib/riot_games_api/lol/resource/static_data.rb, line 134
def api_endpoint(resource_path, api_version)
  "api/lol/static-data/#{@region}/#{api_version}/#{resource_path}"
end
resource_path(path, target_id = nil) click to toggle source
# File lib/riot_games_api/lol/resource/static_data.rb, line 138
def resource_path(path, target_id = nil)
  if target_id
    "#{path}/#{target_id}"
  else
    "#{path}"
  end
end