Module: SimpleSpotify::Actions::Albums
- Defined in:
- lib/simplespotify/actions/albums.rb
Instance Method Summary collapse
- #album(album, market: nil) ⇒ Object
- #album_tracks(album, limit: 20, offset: 0, market: nil) ⇒ Object
- #albums(*albums, market: nil) ⇒ Object
Instance Method Details
#album(album, market: nil) ⇒ Object
5 6 7 8 |
# File 'lib/simplespotify/actions/albums.rb', line 5 def album album, market: nil response = get "albums/#{id_for(album)}", (market, {}) Model::Album.new(response.body) end |
#album_tracks(album, limit: 20, offset: 0, market: nil) ⇒ Object
21 22 23 24 25 |
# File 'lib/simplespotify/actions/albums.rb', line 21 def album_tracks album, limit: 20, offset: 0, market: nil = (market, {limit: limit, offset: offset}) response = get "albums/#{id_for(album)}/tracks", Model::Collection.of(:tracks, response.body) end |
#albums(*albums, market: nil) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/simplespotify/actions/albums.rb', line 11 def albums *albums, market: nil albums = albums.map {|a| id_for(a) }.join(',') response = get "albums", (market, {ids: albums}) Model::Collection.of(:albums, response.body) end |