vigor 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/vigor.rb +3 -3
- metadata +1 -1
data/lib/vigor.rb
CHANGED
@@ -3,16 +3,16 @@ require 'httparty'
|
|
3
3
|
module Vigor
|
4
4
|
class Client
|
5
5
|
include HTTParty
|
6
|
-
base_uri "http://prod.api.pvp.net/api/lol/na/v1.1"
|
7
6
|
# debug_output $stderr
|
8
7
|
|
9
|
-
def initialize(api_key)
|
8
|
+
def initialize(api_key, region = "na")
|
10
9
|
self.class.default_params :api_key => api_key
|
10
|
+
self.class.base_uri "http://prod.api.pvp.net/api/lol/#{region}/v1.1"
|
11
11
|
end
|
12
12
|
|
13
13
|
def summoner(lookup_value)
|
14
14
|
if lookup_value.is_a? String
|
15
|
-
return Summoner.new(self.class.get("/summoner/by-name/" + lookup_value))
|
15
|
+
return Summoner.new(self.class.get("/summoner/by-name/" + lookup_value.gsub(/\s+/, "")))
|
16
16
|
else
|
17
17
|
return Summoner.new(self.class.get("/summoner/" + lookup_value.to_s))
|
18
18
|
end
|