module RiotLolApi::Request::Mastery
Public Instance Methods
get_all_masteries(data = nil, locale = 'en_US')
click to toggle source
# File lib/riot_lol_api/requests/masteries.rb, line 4 def get_all_masteries(data = nil, locale = 'en_US') data.merge!(locale: locale) response = get(url: "static-data/#{@region}/v1.2/mastery", domaine: 'global', data: data) return nil if response.nil? tab_masteries = [] response['data'].each do |mastery| tab_masteries << RiotLolApi::Model::Mastery.new(mastery[1].lol_symbolize.merge(client: self)) end tab_masteries end
get_mastery_by_id(id, data = {}, locale = 'en_US')
click to toggle source
# File lib/riot_lol_api/requests/masteries.rb, line 15 def get_mastery_by_id(id, data = {}, locale = 'en_US') data.merge!(locale: locale) response = get(url: "static-data/#{@region}/v1.2/mastery/#{id}", domaine: 'global', data: data) return nil if response.nil? RiotLolApi::Model::Mastery.new(response.lol_symbolize.merge(client: self)) end