Class: Rocksky::Resources::Spotify
- Defined in:
- lib/rocksky/resources/spotify.rb
Overview
‘app.rocksky.spotify.*` endpoints — Spotify remote control for the authenticated user.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get_currently_playing(actor: nil) ⇒ Object
Currently playing on Spotify.
-
#next ⇒ Object
Skip to next track.
-
#pause ⇒ Object
Pause Spotify playback.
-
#play ⇒ Object
Resume Spotify playback.
-
#previous ⇒ Object
Go to previous track.
-
#seek(position:) ⇒ Object
Seek to position in milliseconds.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Rocksky::Resources::Base
Instance Method Details
#get_currently_playing(actor: nil) ⇒ Object
Currently playing on Spotify.
7 8 9 |
# File 'lib/rocksky/resources/spotify.rb', line 7 def (actor: nil) query("app.rocksky.spotify.getCurrentlyPlaying", actor: actor) end |
#next ⇒ Object
Skip to next track.
22 23 24 |
# File 'lib/rocksky/resources/spotify.rb', line 22 def next procedure("app.rocksky.spotify.next") end |
#pause ⇒ Object
Pause Spotify playback.
17 18 19 |
# File 'lib/rocksky/resources/spotify.rb', line 17 def pause procedure("app.rocksky.spotify.pause") end |
#play ⇒ Object
Resume Spotify playback.
12 13 14 |
# File 'lib/rocksky/resources/spotify.rb', line 12 def play procedure("app.rocksky.spotify.play") end |
#previous ⇒ Object
Go to previous track.
27 28 29 |
# File 'lib/rocksky/resources/spotify.rb', line 27 def previous procedure("app.rocksky.spotify.previous") end |
#seek(position:) ⇒ Object
Seek to position in milliseconds.
32 33 34 |
# File 'lib/rocksky/resources/spotify.rb', line 32 def seek(position:) procedure("app.rocksky.spotify.seek", params: { position: position }) end |