class RubyGg::Client

Attributes

api_key[R]
base_url[R]
region[RW]

Public Class Methods

new(api_key, region = 'na') click to toggle source
# File lib/ruby_gg/client.rb, line 10
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

Public Instance Methods

challenger() click to toggle source
# File lib/ruby_gg/client.rb, line 28
def challenger
    @challenger = Challenger.new(@api_key, @region)
end
champion() click to toggle source
# File lib/ruby_gg/client.rb, line 36
def champion
    @champion = Champion.new(@api_key, @region)
end
summoner() click to toggle source
# File lib/ruby_gg/client.rb, line 32
def summoner
    @summoner = Summoner.new(@api_key, @region)
end