class Clashinator::Client

Client class that acts as interface of http methods available for the client itself

Attributes

headers[R]
token[R]
uri[R]

Public Class Methods

new(token) click to toggle source
# File lib/clashinator/client.rb, line 8
def initialize(token)
  @token = token
  @uri = 'https://api.clashofclans.com'
  @headers = { 'Authorization' => "Bearer #{@token}" }
  @conn = Faraday.new(
    url: @uri,
    headers: @headers
  )
end

Public Instance Methods

clan_info(tag) click to toggle source
# File lib/clashinator/client.rb, line 24
def clan_info(tag)
  Clashinator::Clan.clan_info(@conn, tag)
end
clan_war_log(tag, options = {}) click to toggle source
# File lib/clashinator/client.rb, line 32
def clan_war_log(tag, options = {})
  Clashinator::Clan.clan_war_log(@conn, tag, options)
end
league_info(league_id) click to toggle source
# File lib/clashinator/client.rb, line 64
def league_info(league_id)
  Clashinator::League.league_info(@conn, league_id)
end
league_season_rankings(league_id, season_id, options = {}) click to toggle source
# File lib/clashinator/client.rb, line 72
def league_season_rankings(league_id, season_id, options = {})
  Clashinator::League.league_season_rankings(
    @conn, league_id, season_id, options
  )
end
league_seasons(league_id, options = {}) click to toggle source
# File lib/clashinator/client.rb, line 68
def league_seasons(league_id, options = {})
  Clashinator::League.league_seasons(@conn, league_id, options)
end
list_clan_members(tag, options = {}) click to toggle source
# File lib/clashinator/client.rb, line 28
def list_clan_members(tag, options = {})
  Clashinator::Clan.list_clan_members(@conn, tag, options)
end
list_leagues(options = {}) click to toggle source

league class methods

# File lib/clashinator/client.rb, line 60
def list_leagues(options = {})
  Clashinator::League.list_leagues(@conn, options)
end
list_locations(options = {}) click to toggle source

location class methods

# File lib/clashinator/client.rb, line 38
def list_locations(options = {})
  Clashinator::Location.list_locations(@conn, options)
end
location_clan_rankings(location_id, options = {}) click to toggle source
# File lib/clashinator/client.rb, line 46
def location_clan_rankings(location_id, options = {})
  Clashinator::Location.location_clan_rankings(
    @conn, location_id, options
  )
end
location_info(location_id) click to toggle source
# File lib/clashinator/client.rb, line 42
def location_info(location_id)
  Clashinator::Location.location_info(@conn, location_id)
end
location_player_rankings(player_tag, options = {}) click to toggle source
# File lib/clashinator/client.rb, line 52
def location_player_rankings(player_tag, options = {})
  Clashinator::Location.location_player_rankings(
    @conn, player_tag, options
  )
end
player_info(tag) click to toggle source

player class methods

# File lib/clashinator/client.rb, line 80
def player_info(tag)
  Clashinator::Player.player_info(@conn, tag)
end
search_clans(options) click to toggle source

client class methods

# File lib/clashinator/client.rb, line 20
def search_clans(options)
  Clashinator::Clan.search_clans(@conn, options)
end