Module: RelicLink::Coh3::Api::Endpoints::Matches

Included in:
RelicLink::Coh3::Api::Endpoints
Defined in:
lib/relic_link/coh3/api/endpoints/matches.rb

Overview

Endpoint definitions for the CoH3 recent matches API.

Instance Method Summary collapse

Instance Method Details

#recent_match_history(options = {}) ⇒ Object

Retrieve the match history information for the given player identifiers. Note that multiple combinations of identifier types (such as profile_ids and aliases or aliases and profile_names) are technically supported but produce undefined behaviour on Relic’s API. Therefore, it is recommended to choose one identifier type when making requests to this endpoint.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :profile_ids (Array<Integer>)

    Internal Relic IDs of players whose stats you wish to retrieve (one of required).

  • :aliases (Array<String>)

    Steam profile names of players whose stats you wish to retrieve. Names must match exactly and are case sensitive (one of required).

  • :profile_names (Array<Integer>)

    Specially formatted Steam IDs of players whose stats you wish to retrieve. Must be in the format /steam/<ID> (one of required).

Raises:



31
32
33
34
35
36
37
# File 'lib/relic_link/coh3/api/endpoints/matches.rb', line 31

def recent_match_history(options = {})
  unless options.keys.intersect?(%i[profile_ids aliases profile_names])
    raise ArgumentError, 'Missing one of required arguments :profile_ids, :aliases, or :profile_names'
  end

  get(stats, 'getRecentMatchHistory', array_params(options))
end

#recent_match_history_by_profile_id(profile_id) ⇒ Object

Retrieve the match history information for the given profile ID. Profile ID is an internal Relic player identifier that can be pulled from leaderboard results (such as by calling Leaderboards#leaderboard) or match history results (like #recent_match_history) using other known parameters such as aliases or profile_names.

Parameters:

  • profile_id (Integer)

    Internal Relic ID of player whose stats you wish to retrieve (required).

Raises:



51
52
53
54
55
# File 'lib/relic_link/coh3/api/endpoints/matches.rb', line 51

def recent_match_history_by_profile_id(profile_id)
  raise ArgumentError, 'Required argument :profile_id missing' if profile_id.nil?

  get(stats, 'getRecentMatchHistoryByProfileId', { profile_id: })
end