Class: Lol::StaticRequest

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

Defined Under Namespace

Classes: Proxy

Instance Attribute Summary

Attributes inherited from Request

#api_key, #cache_store, #rate_limiter, #region

Instance Method Summary collapse

Methods inherited from Request

#api_base_url, #api_query_string, #api_url, #api_version, api_version, #cached?, #clean_url, #initialize, #perform_rate_limited_request, #perform_request, #perform_uncached_request, #platform, platforms, #store, #ttl

Constructor Details

This class inherits a constructor from Lol::Request

Instance Method Details

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



48
49
50
51
# File 'lib/lol/static_request.rb', line 48

def get(endpoint, id=nil, params={})
  return perform_request(api_url("versions")) if endpoint == "versions"
  id ? find(endpoint, id, params) : all(endpoint, params)
end

#language_strings(params = {}) ⇒ Object



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

def language_strings params={}
  perform_request(api_url "language-strings", params).to_hash["data"]
end

#languagesObject



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

def languages
  perform_request api_url "languages"
end

#mapsObject



28
29
30
# File 'lib/lol/static_request.rb', line 28

def maps
  Proxy.new self, "maps"
end

#profile_icons(params = {}) ⇒ Object



32
33
34
# File 'lib/lol/static_request.rb', line 32

def profile_icons params={}
  all "profile_icons", params
end

#realmsObject



36
37
38
# File 'lib/lol/static_request.rb', line 36

def realms
  Proxy.new self, "realms"
end

#reforged_runesObject



40
41
42
# File 'lib/lol/static_request.rb', line 40

def reforged_runes
  Proxy.new self, "reforged_runes"
end

#versionsObject



44
45
46
# File 'lib/lol/static_request.rb', line 44

def versions
  Proxy.new self, "versions"
end