Class: Spotted::Resources::Tracks
- Inherits:
-
Object
- Object
- Spotted::Resources::Tracks
- Defined in:
- lib/spotted/resources/tracks.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Tracks
constructor
private
A new instance of Tracks.
-
#list(ids: , market: nil, request_options: {}) ⇒ Spotted::Models::TrackListResponse
Some parameter documentations has been truncated, see Models::TrackListParams for more details.
-
#retrieve(id, market: nil, request_options: {}) ⇒ Spotted::Models::TrackObject
Some parameter documentations has been truncated, see Models::TrackRetrieveParams for more details.
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.
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.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/spotted/resources/tracks.rb', line 50 def list(params) parsed, = Spotted::TrackListParams.dump_request(params) @client.request( method: :get, path: "tracks", query: parsed, model: Spotted::Models::TrackListResponse, 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.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/spotted/resources/tracks.rb', line 23 def retrieve(id, params = {}) parsed, = Spotted::TrackRetrieveParams.dump_request(params) @client.request( method: :get, path: ["tracks/%1$s", id], query: parsed, model: Spotted::TrackObject, options: ) end |