Class: Spotify::ArtistsResource
Instance Attribute Summary
Attributes inherited from Resource
#client
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#albums(id:, **params) ⇒ Object
11
12
13
14
|
# File 'lib/spotify/resources/artists.rb', line 11
def albums(id:, **params)
response = get_request("artists/#{id}/albums", params: params)
Collection.from_response(response, type: Album, key: "items")
end
|
#get(id:, market: nil) ⇒ Object
7
8
9
10
|
# File 'lib/spotify/resources/artists.rb', line 7
def get(id:, market: nil)
response = get_request("artists/#{id}", params: { market: market })
Artist.new response.body
end
|
#list(ids:) ⇒ Object
3
4
5
6
|
# File 'lib/spotify/resources/artists.rb', line 3
def list(ids:)
response = get_request("artists", params: { ids: ids })
Collection.from_response(response, type: Artist, key: "artists")
end
|
#top_tracks(id:, market: nil) ⇒ Object
15
16
17
18
|
# File 'lib/spotify/resources/artists.rb', line 15
def top_tracks(id:, market: nil)
response = get_request("artists/#{id}/top-tracks", params: { market: market })
Collection.from_response(response, type: Track, key: "tracks")
end
|