Class: Spotted::Resources::Browse

Inherits:
Object
  • Object
show all
Defined in:
lib/spotted/resources/browse.rb,
lib/spotted/resources/browse/categories.rb

Defined Under Namespace

Classes: Categories

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Browse

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 Browse.

Parameters:



72
73
74
75
# File 'lib/spotted/resources/browse.rb', line 72

def initialize(client:)
  @client = client
  @categories = Spotted::Resources::Browse::Categories.new(client: client)
end

Instance Attribute Details

#categoriesSpotted::Resources::Browse::Categories (readonly)



7
8
9
# File 'lib/spotted/resources/browse.rb', line 7

def categories
  @categories
end

Instance Method Details

Deprecated.

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

Get a list of Spotify featured playlists (shown, for example, on a Spotify player’s ‘Browse’ tab).

Parameters:

  • limit (Integer)

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

  • locale (String)

    The desired language, consisting of an [ISO 639-1](en.wikipedia.org/wiki/

  • offset (Integer)

    The index of the first item to return. Default: 0 (the first item). Use with lim

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

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
# File 'lib/spotted/resources/browse.rb', line 30

def get_featured_playlists(params = {})
  parsed, options = Spotted::BrowseGetFeaturedPlaylistsParams.dump_request(params)
  @client.request(
    method: :get,
    path: "browse/featured-playlists",
    query: parsed,
    model: Spotted::Models::BrowseGetFeaturedPlaylistsResponse,
    options: options
  )
end

#get_new_releases(limit: nil, offset: nil, request_options: {}) ⇒ Spotted::Models::BrowseGetNewReleasesResponse

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

Get a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab).

Parameters:

  • limit (Integer)

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

  • offset (Integer)

    The index of the first item to return. Default: 0 (the first item). Use with lim

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

Returns:

See Also:



58
59
60
61
62
63
64
65
66
67
# File 'lib/spotted/resources/browse.rb', line 58

def get_new_releases(params = {})
  parsed, options = Spotted::BrowseGetNewReleasesParams.dump_request(params)
  @client.request(
    method: :get,
    path: "browse/new-releases",
    query: parsed,
    model: Spotted::Models::BrowseGetNewReleasesResponse,
    options: options
  )
end