Class: Spotify::UsersResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/spotify/resources/users.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Spotify::Resource

Instance Method Details

#get(id:) ⇒ Object



3
4
5
6
# File 'lib/spotify/resources/users.rb', line 3

def get(id:)
  response = get_request("users/#{id}")
  User.new response.body
end

#playlists(id:, **params) ⇒ Object



8
9
10
11
# File 'lib/spotify/resources/users.rb', line 8

def playlists(id:, **params)
  response = get_request("users/#{id}/playlists", params: params)
  Collection.from_response(response, type: Playlist, key: "items")
end