Class: Vigor::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/vigor.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key, region = "na") ⇒ Client

debug_output $stderr



8
9
10
11
# File 'lib/vigor.rb', line 8

def initialize(api_key, region = "na")
  self.class.default_params :api_key => api_key
  self.class.base_uri "http://prod.api.pvp.net/api/lol/#{region}/v1.1"
end

Instance Method Details

#summoner(lookup_value) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/vigor.rb', line 13

def summoner(lookup_value)
  if lookup_value.is_a? String
    return Summoner.new(self.class.get("/summoner/by-name/" + lookup_value.gsub(/\s+/, "")))
  else
    return Summoner.new(self.class.get("/summoner/" + lookup_value.to_s))
  end
end