Class: Lol::ChampionRequest

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

Overview

Bindings for the Champion API.

See: developer.riotgames.com/api-methods/#champion-v3

Instance Attribute Summary

Attributes inherited from Request

#api_key, #cache_store, #rate_limiter, #region

Instance Method Summary collapse

Methods inherited from Request

#api_base_path, #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

#all(free_to_play: false) ⇒ Array<Lol::DynamicModel>


11
12
13
14
# File 'lib/lol/champion_request.rb', line 11

def all free_to_play: false
  result = perform_request api_url("champions", "freeToPlay" => free_to_play)
  result["champions"].map { |c| DynamicModel.new c }
end

#find(id) ⇒ Lol::DynamicModel


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

def find id
  result = perform_request api_url "champions/#{id}"
  DynamicModel.new result
end