Class: Spotify::TracksResource

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

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Spotify::Resource

Instance Method Details

#get(id:, **params) ⇒ Object



7
8
9
10
# File 'lib/spotify/resources/tracks.rb', line 7

def get(id:, **params)
  response = get_request("tracks/#{id}", params: params)
  Track.new response.body
end

#list(ids:, **params) ⇒ Object



3
4
5
6
# File 'lib/spotify/resources/tracks.rb', line 3

def list(ids:, **params)
  response = get_request("tracks", params: { ids: ids }.merge(params))
  Collection.from_response(response, type: Track, key: "tracks")
end