Class: Starcall::StaticData

Inherits:
Object
  • Object
show all
Defined in:
lib/starcall/static_data.rb

Overview

This class is used for all things Static Data related. Using Riots Static data and Data Dragon.

Instance Method Summary collapse

Constructor Details

#initialize(region: 'euw', language: 'en_GB') ⇒ StaticData

Initialize the class with a region, if none is supplied, EUW will be assumed.



10
11
12
13
14
15
16
# File 'lib/starcall/static_data.rb', line 10

def initialize(region: 'euw', language: 'en_GB')
  Starcall::Regions.valid?(region: region)
  Starcall::Languages.valid?(language: language)

  @region = region
  @language = language
end

Instance Method Details

#dd_championsObject

This returns a list of all champion with a brief summary, including stats, id and blurb.



61
62
63
# File 'lib/starcall/static_data.rb', line 61

def dd_champions
  Starcall::ApiRequests.make_request(url: dd_url(game_component: 'champion'))
end

#dd_itemsObject

Data Dragon also provides detail for every item in the game. with this method you can find info such as the item’s description, purchase value, sell value, items it builds from, items it builds into, and stats granted from the item.



73
74
75
# File 'lib/starcall/static_data.rb', line 73

def dd_items
  Starcall::ApiRequests.make_request(url: dd_url(game_component: 'item'))
end

#dd_profile_iconsObject

Details about profile icons and where they can be found on the sprite sheets.



83
84
85
# File 'lib/starcall/static_data.rb', line 83

def dd_profile_icons
  Starcall::ApiRequests.make_request(url: dd_url(game_component: 'profileicon'))
end

#dd_region_versionsObject

Data Dragon versions aren’t always equivalent to the League of Legends client version in a region.



56
57
58
# File 'lib/starcall/static_data.rb', line 56

def dd_region_versions
  Starcall::ApiRequests.make_request(url: dd_region_version_url)
end

#dd_specific_champion(champion_name:) ⇒ Object

For me detailed and specific information about a champion, this call can be used.



66
67
68
# File 'lib/starcall/static_data.rb', line 66

def dd_specific_champion(champion_name:)
  Starcall::ApiRequests.make_request(url: dd_specific_champion_url(champion_name: champion_name))
end

#dd_summoner_spellsObject

Details about summoner spells.



78
79
80
# File 'lib/starcall/static_data.rb', line 78

def dd_summoner_spells
  Starcall::ApiRequests.make_request(url: dd_url(game_component: 'summoner'))
end

#dd_versionsObject

All valid Data Dragon versions can be can be retrieved with the below method. Typically there’s only a single build of Data Dragon for a given patch, however occasionally there will be additional builds. This typically occurs when there’s an error in the original build. As such, you should always use the most recent Data Dragon version for a given patch for the best results.



51
52
53
# File 'lib/starcall/static_data.rb', line 51

def dd_versions
  Starcall::ApiRequests.make_request(url: dd_versions_url)
end

#game_modesObject

A full list of game modes can be can be retrieved with the below method.



37
38
39
# File 'lib/starcall/static_data.rb', line 37

def game_modes
  Starcall::ApiRequests.make_request(url: static_url(search_term: 'gameModes'))
end

#game_typesObject

A full list of game types can be can be retrieved with the below method.



42
43
44
# File 'lib/starcall/static_data.rb', line 42

def game_types
  Starcall::ApiRequests.make_request(url: static_url(search_term: 'gameTypes'))
end

#map_idsObject

Map ids are used in match history to indicate which map a match was played. A full list of map ids can be can be retrieved with the below method.



32
33
34
# File 'lib/starcall/static_data.rb', line 32

def map_ids
  Starcall::ApiRequests.make_request(url: static_url(search_term: 'maps'))
end

#queue_idsObject

Queue ids show up in several places throughout the API and are used to indicate which kind of match was played. A full list of queue ids can be can be retrieved with the below method.



26
27
28
# File 'lib/starcall/static_data.rb', line 26

def queue_ids
  Starcall::ApiRequests.make_request(url: static_url(search_term: 'queues'))
end

#season_idsObject

Season ids are used in match history to indicate which season a match was played. A full list of season ids can be retrieved with the below method.



20
21
22
# File 'lib/starcall/static_data.rb', line 20

def season_ids
  Starcall::ApiRequests.make_request(url: static_url(search_term: 'seasons'))
end