Class: Spotted::Resources::Playlists
- Inherits:
-
Object
- Object
- Spotted::Resources::Playlists
- Defined in:
- lib/spotted/resources/playlists.rb,
lib/spotted/resources/playlists/images.rb,
lib/spotted/resources/playlists/tracks.rb,
lib/spotted/resources/playlists/followers.rb
Defined Under Namespace
Classes: Followers, Images, Tracks
Instance Attribute Summary collapse
- #followers ⇒ Spotted::Resources::Playlists::Followers readonly
- #images ⇒ Spotted::Resources::Playlists::Images readonly
- #tracks ⇒ Spotted::Resources::Playlists::Tracks readonly
Instance Method Summary collapse
-
#initialize(client:) ⇒ Playlists
constructor
private
A new instance of Playlists.
-
#retrieve(playlist_id, additional_types: nil, fields: nil, market: nil, request_options: {}) ⇒ Spotted::Models::PlaylistRetrieveResponse
Some parameter documentations has been truncated, see Models::PlaylistRetrieveParams for more details.
-
#update(playlist_id, collaborative: nil, description: nil, name: nil, public: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::PlaylistUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Playlists
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 Playlists.
83 84 85 86 87 88 |
# File 'lib/spotted/resources/playlists.rb', line 83 def initialize(client:) @client = client @tracks = Spotted::Resources::Playlists::Tracks.new(client: client) @followers = Spotted::Resources::Playlists::Followers.new(client: client) @images = Spotted::Resources::Playlists::Images.new(client: client) end |
Instance Attribute Details
#followers ⇒ Spotted::Resources::Playlists::Followers (readonly)
10 11 12 |
# File 'lib/spotted/resources/playlists.rb', line 10 def followers @followers end |
#images ⇒ Spotted::Resources::Playlists::Images (readonly)
13 14 15 |
# File 'lib/spotted/resources/playlists.rb', line 13 def images @images end |
#tracks ⇒ Spotted::Resources::Playlists::Tracks (readonly)
7 8 9 |
# File 'lib/spotted/resources/playlists.rb', line 7 def tracks @tracks end |
Instance Method Details
#retrieve(playlist_id, additional_types: nil, fields: nil, market: nil, request_options: {}) ⇒ Spotted::Models::PlaylistRetrieveResponse
Some parameter documentations has been truncated, see Models::PlaylistRetrieveParams for more details.
Get a playlist owned by a Spotify user.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/spotted/resources/playlists.rb', line 35 def retrieve(playlist_id, params = {}) parsed, = Spotted::PlaylistRetrieveParams.dump_request(params) @client.request( method: :get, path: ["playlists/%1$s", playlist_id], query: parsed, model: Spotted::Models::PlaylistRetrieveResponse, options: ) end |
#update(playlist_id, collaborative: nil, description: nil, name: nil, public: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::PlaylistUpdateParams for more details.
Change a playlist’s name and public/private state. (The user must, of course, own the playlist.)
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/spotted/resources/playlists.rb', line 69 def update(playlist_id, params = {}) parsed, = Spotted::PlaylistUpdateParams.dump_request(params) @client.request( method: :put, path: ["playlists/%1$s", playlist_id], body: parsed, model: NilClass, options: ) end |