class Brawlstats

Public Class Methods

new(api_key) click to toggle source
# File brawlstats.rb, line 16
def initialize api_key
    @base_url = "https://api.brawlstars.com/v1"
    @authorization = "Bearer #{api_key}"
end

Public Instance Methods

get_brawler(brawler_id) click to toggle source
# File brawlstats.rb, line 50
def get_brawler brawler_id
    return make_req "#{@base_url}/brawlers/#{brawler_id}", @authorization
end
get_brawler_rankings(brawler_id, country_code='global') click to toggle source
# File brawlstats.rb, line 41
def get_brawler_rankings brawler_id, country_code='global'
    return make_req "#{@base_url}/rankings/#{country_code}/brawlers/#{brawler_id}", @authorization
end
get_brawlers() click to toggle source
# File brawlstats.rb, line 47
def get_brawlers
    return make_req "#{@base_url}/brawlers", @authorization
end
get_club(club_tag) click to toggle source
# File brawlstats.rb, line 26
def get_club club_tag
    return make_req "#{@base_url}/clubs/%23#{club_tag}", @authorization
end
get_club_members(club_tag) click to toggle source
# File brawlstats.rb, line 29
def get_club_members club_tag
    return make_req "#{@base_url}/clubs/%23#{club_tag}/members", @authorization
end
get_club_rankings(country_code='global') click to toggle source
# File brawlstats.rb, line 38
def get_club_rankings country_code='global'
    return make_req "#{@base_url}/rankings/#{country_code}/clubs", @authorization
end
get_player(player_tag) click to toggle source
# File brawlstats.rb, line 20
def get_player player_tag
    return make_req "#{@base_url}/players/%23#{player_tag}", @authorization
end
get_player_battlelog(player_tag) click to toggle source
# File brawlstats.rb, line 23
def get_player_battlelog player_tag
    return make_req "#{@base_url}/players/%23#{player_tag}/battlelog", @authorization
end
get_player_rankings(country_code='global') click to toggle source
# File brawlstats.rb, line 44
def get_player_rankings country_code='global'
    return make_req "#{@base_url}/rankings/#{country_code}/players", @authorization
end
get_powerplay_rankings(season_id, country_code='global') click to toggle source
# File brawlstats.rb, line 32
def get_powerplay_rankings season_id, country_code='global'
    return make_req "#{@base_url}/rankings/#{country_code}/powerplay/seasons/#{season_id}", @authorization
end
get_powerplay_seasons(country_code='global') click to toggle source
# File brawlstats.rb, line 35
def get_powerplay_seasons country_code='global'
    return make_req "#{@base_url}/rankings/#{country_code}/powerplay/seasons", @authorization
end