Class: Lol::StaticRequest
Defined Under Namespace
Classes: Proxy
Constant Summary collapse
- STANDARD_ENDPOINTS =
%w(champion item mastery rune summoner_spell)
Instance Attribute Summary
Attributes inherited from Request
#api_key, #cache_store, #region
Class Method Summary collapse
Instance Method Summary collapse
-
#api_url(path, params = {}) ⇒ String
Returns a full url for an API call Overrides api_url from Request.
- #get(endpoint, id = nil, params = {}) ⇒ Object
- #realm ⇒ Object
- #versions ⇒ Object
Methods inherited from Request
#api_base_url, #api_query_string, #cached?, #clean_url, #initialize, #perform_request, #post_api_url, #store, #ttl
Constructor Details
This class inherits a constructor from Lol::Request
Class Method Details
.api_version ⇒ Object
5 6 7 |
# File 'lib/lol/static_request.rb', line 5 def self.api_version "v1.2" end |
Instance Method Details
#api_url(path, params = {}) ⇒ String
Returns a full url for an API call Overrides api_url from Request
13 14 15 |
# File 'lib/lol/static_request.rb', line 13 def api_url path, params = {} super(path,params).gsub(/api\/lol/, "api/lol/static-data").gsub(/\/\/#{region}/, "//global") end |
#get(endpoint, id = nil, params = {}) ⇒ Object
29 30 31 32 |
# File 'lib/lol/static_request.rb', line 29 def get(endpoint, id=nil, params={}) return perform_request(api_url("versions")).map {|x| x} if endpoint == "versions" id ? find(endpoint, id, params) : all(endpoint, params) end |
#realm ⇒ Object
21 22 23 |
# File 'lib/lol/static_request.rb', line 21 def realm Proxy.new self, 'realm' end |
#versions ⇒ Object
25 26 27 |
# File 'lib/lol/static_request.rb', line 25 def versions Proxy.new self, 'versions' end |