Class: Rocksky::Resources::Spotify

Inherits:
Base
  • Object
show all
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

#http

Instance Method Summary collapse

Methods inherited from Base

#initialize

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 get_currently_playing(actor: nil)
  query("app.rocksky.spotify.getCurrentlyPlaying", actor: actor)
end

#nextObject

Skip to next track.



22
23
24
# File 'lib/rocksky/resources/spotify.rb', line 22

def next
  procedure("app.rocksky.spotify.next")
end

#pauseObject

Pause Spotify playback.



17
18
19
# File 'lib/rocksky/resources/spotify.rb', line 17

def pause
  procedure("app.rocksky.spotify.pause")
end

#playObject

Resume Spotify playback.



12
13
14
# File 'lib/rocksky/resources/spotify.rb', line 12

def play
  procedure("app.rocksky.spotify.play")
end

#previousObject

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