Class: Lol::StaticRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/lol/static_request.rb

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

Methods inherited from Request

#cached?, #initialize, #perform_request, #store, #ttl

Constructor Details

This class inherits a constructor from Lol::Request

Class Method Details

.api_versionObject



5
6
7
# File 'lib/lol/static_request.rb', line 5

def self.api_version
  "v1"
end

Instance Method Details

#api_url(path, params = {}) ⇒ String

Returns a full url for an API call Overrides api_url from Request

Parameters:

  • path (String)

    API path to call

Returns:

  • (String)

    full fledged url



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")
end

#get(endpoint, id = nil, params = {}) ⇒ Object



25
26
27
# File 'lib/lol/static_request.rb', line 25

def get(endpoint, id=nil, params={})
  id ? find(endpoint, id, params) : all(endpoint, params)
end

#realmObject



21
22
23
# File 'lib/lol/static_request.rb', line 21

def realm
  Proxy.new self, 'realm'
end