Module: RelicLink::Coh3::Api::Endpoints::Stats

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

Overview

Endpoint definitions for the CoH3 stats API.

Instance Method Summary collapse

Instance Method Details

#personal_stats(options = {}) ⇒ Object

Retrieve the personal stats 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/stats.rb', line 31

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

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