class Lol::ChampionRequest
Bindings for the Champion API.
Public Instance Methods
all(free_to_play: false)
click to toggle source
Retrieve all champions
See: developer.riotgames.com/api-methods/#champion-v3/GET_getChampions @param free_to_play [Boolean] filter param to retrieve only free to play champions @return [Array<Lol::DynamicModel>] an array of champions
# 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)
click to toggle source
Retrieve champion by ID
See: developer.riotgames.com/api-methods/#champion-v3/GET_getChampionsById @param id [Integer] id of the champion to get @return [Lol::DynamicModel] the found champion
# File lib/lol/champion_request.rb, line 21 def find id result = perform_request api_url "champions/#{id}" DynamicModel.new result end