Class: Spotted::Resources::Me::Playlists

Inherits:
Object
  • Object
show all
Defined in:
lib/spotted/resources/me/playlists.rb

Instance Method Summary collapse

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.

Parameters:



38
39
40
# File 'lib/spotted/resources/me/playlists.rb', line 38

def initialize(client:)
  @client = client
end

Instance Method Details

#list(limit: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::SimplifiedPlaylistObject>

Some parameter documentations has been truncated, see Models::Me::PlaylistListParams for more details.

Get a list of the playlists owned or followed by the current Spotify user.

Parameters:

  • limit (Integer)

    The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.

  • offset (Integer)

    ‘The index of the first playlist to return. Default:

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/spotted/resources/me/playlists.rb', line 23

def list(params = {})
  parsed, options = Spotted::Me::PlaylistListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "me/playlists",
    query: parsed,
    page: Spotted::Internal::CursorURLPage,
    model: Spotted::SimplifiedPlaylistObject,
    options: options
  )
end