Class: Spotted::Resources::Tracks

Inherits:
Object
  • Object
show all
Defined in:
lib/spotted/resources/tracks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tracks

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Tracks.

Parameters:



64
65
66
# File 'lib/spotted/resources/tracks.rb', line 64

def initialize(client:)
  @client = client
end

Instance Method Details

#list(ids: , market: nil, request_options: {}) ⇒ Spotted::Models::TrackListResponse

Some parameter documentations has been truncated, see Models::TrackListParams for more details.

Get Spotify catalog information for multiple tracks based on their Spotify IDs.

Parameters:

Returns:

See Also:



50
51
52
53
54
55
56
57
58
59
# File 'lib/spotted/resources/tracks.rb', line 50

def list(params)
  parsed, options = Spotted::TrackListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "tracks",
    query: parsed,
    model: Spotted::Models::TrackListResponse,
    options: options
  )
end

#retrieve(id, market: nil, request_options: {}) ⇒ Spotted::Models::TrackObject

Some parameter documentations has been truncated, see Models::TrackRetrieveParams for more details.

Get Spotify catalog information for a single track identified by its unique Spotify ID.

Parameters:

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
# File 'lib/spotted/resources/tracks.rb', line 23

def retrieve(id, params = {})
  parsed, options = Spotted::TrackRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["tracks/%1$s", id],
    query: parsed,
    model: Spotted::TrackObject,
    options: options
  )
end