Class: Vigor::Client
Instance Method Summary collapse
-
#initialize(api_key, region = "na") ⇒ Client
constructor
debug_output $stderr.
- #summoner(lookup_value) ⇒ Object
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 |