Class: Lol::Client
- Inherits:
-
Object
- Object
- Lol::Client
- Defined in:
- lib/lol/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ String
readonly
The API key that has been used.
-
#region ⇒ String
Name of region.
Instance Method Summary collapse
- #champion ⇒ ChampionRequest
- #game ⇒ GameRequest
-
#initialize(api_key, options = {}) ⇒ Lol::Client
constructor
Initializes a Lol::Client.
- #league ⇒ LeagueRequest
- #static ⇒ StaticRequest
- #stats ⇒ StatsRequest
- #summoner ⇒ SummonerRequest
- #team ⇒ TeamRequest
Constructor Details
#initialize(api_key, options = {}) ⇒ Lol::Client
Initializes a Lol::Client
52 53 54 55 |
# File 'lib/lol/client.rb', line 52 def initialize api_key, = {} @api_key = api_key @region = .delete(:region) || "euw" end |
Instance Attribute Details
#api_key ⇒ String (readonly)
Returns the API key that has been used.
10 11 12 |
# File 'lib/lol/client.rb', line 10 def api_key @api_key end |
#region ⇒ String
Returns name of region.
6 7 8 |
# File 'lib/lol/client.rb', line 6 def region @region end |
Instance Method Details
#champion ⇒ ChampionRequest
13 14 15 |
# File 'lib/lol/client.rb', line 13 def champion @champion_request ||= ChampionRequest.new(api_key, region) end |
#game ⇒ GameRequest
18 19 20 |
# File 'lib/lol/client.rb', line 18 def game @game_request ||= GameRequest.new(api_key, region) end |
#league ⇒ LeagueRequest
28 29 30 |
# File 'lib/lol/client.rb', line 28 def league @league_request ||= LeagueRequest.new(api_key, region) end |
#static ⇒ StaticRequest
43 44 45 |
# File 'lib/lol/client.rb', line 43 def static @static_request ||= StaticRequest.new(api_key, region) end |
#stats ⇒ StatsRequest
23 24 25 |
# File 'lib/lol/client.rb', line 23 def stats @stats_request ||= StatsRequest.new(api_key, region) end |
#summoner ⇒ SummonerRequest
38 39 40 |
# File 'lib/lol/client.rb', line 38 def summoner @summoner_request ||= SummonerRequest.new(api_key, region) end |
#team ⇒ TeamRequest
33 34 35 |
# File 'lib/lol/client.rb', line 33 def team @team_request ||= TeamRequest.new(api_key, region) end |