Module: Shikimori::API::V1::Achievements

Included in:
Shikimori::API::V1
Defined in:
lib/shikimori/api/v1/achievements.rb

Overview

Methods for the Achievements API

Instance Method Summary collapse

Instance Method Details

#achievements(user_id:, headers: nil, **query) ⇒ Array<Hash>

Get list of Achievements

Examples:

Get a achievements for user with id equal to 1

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v1.achievements(user_id: 1) #=> [{ id: 1, ... }]

Parameters:

  • user_id (Integer)

    User’s ID

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Array<Hash>)

    Array of hashes representing user’s achievements

See Also:



26
27
28
# File 'lib/shikimori/api/v1/achievements.rb', line 26

def achievements(user_id:, headers: nil, **query)
  rest.get base_url.join('achievements').url, headers: headers, query: { user_id: user_id }.merge(query)
end