Class: RubyGg::Client
- Inherits:
-
Object
- Object
- RubyGg::Client
- Defined in:
- lib/ruby_gg/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#region ⇒ Object
Returns the value of attribute region.
Instance Method Summary collapse
- #challenger ⇒ Object
-
#initialize(api_key, region = 'na') ⇒ Client
constructor
A new instance of Client.
- #summoner ⇒ Object
Constructor Details
#initialize(api_key, region = 'na') ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ruby_gg/client.rb', line 9 def initialize(api_key, region = 'na') @api_key = api_key region_tag = { :na => 'na1', :eune => 'eun1', :euw => 'euw1', :jp => 'jp1', :kr => 'kr', :lan => 'la1', :las => 'la2', :br => 'br1', :oce => 'oc1', :tr => 'tr1', :ru => 'ru', :pbe => 'pbe1' } @region = region_tag[region.to_sym] @base_url = "https://#{@region}.api.riotgames.com" end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/ruby_gg/client.rb', line 6 def api_key @api_key end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
8 9 10 |
# File 'lib/ruby_gg/client.rb', line 8 def base_url @base_url end |
#region ⇒ Object
Returns the value of attribute region.
7 8 9 |
# File 'lib/ruby_gg/client.rb', line 7 def region @region end |
Instance Method Details
#challenger ⇒ Object
27 28 29 |
# File 'lib/ruby_gg/client.rb', line 27 def challenger @challenger = Challenger.new(@api_key, @region) end |