Class: Spotted::Resources::Me::Player::Queue
- Inherits:
-
Object
- Object
- Spotted::Resources::Me::Player::Queue
- Defined in:
- lib/spotted/resources/me/player/queue.rb
Instance Method Summary collapse
-
#add(uri: , device_id: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Me::Player::QueueAddParams for more details.
-
#get(request_options: {}) ⇒ Spotted::Models::Me::Player::QueueGetResponse
Get the list of objects that make up the user’s queue.
-
#initialize(client:) ⇒ Queue
constructor
private
A new instance of Queue.
Constructor Details
#initialize(client:) ⇒ Queue
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 Queue.
58 59 60 |
# File 'lib/spotted/resources/me/player/queue.rb', line 58 def initialize(client:) @client = client end |
Instance Method Details
#add(uri: , device_id: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Me::Player::QueueAddParams for more details.
Add an item to be played next in the user’s current playback queue. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/spotted/resources/me/player/queue.rb', line 26 def add(params) parsed, = Spotted::Me::Player::QueueAddParams.dump_request(params) @client.request( method: :post, path: "me/player/queue", query: parsed, model: NilClass, options: ) end |
#get(request_options: {}) ⇒ Spotted::Models::Me::Player::QueueGetResponse
Get the list of objects that make up the user’s queue.
46 47 48 49 50 51 52 53 |
# File 'lib/spotted/resources/me/player/queue.rb', line 46 def get(params = {}) @client.request( method: :get, path: "me/player/queue", model: Spotted::Models::Me::Player::QueueGetResponse, options: params[:request_options] ) end |