Class: Drum::Service
Overview
A wrapper around a music streaming service's API providing methods for downloading/uploading playlists.
Direct Known Subclasses
AppleMusicService, FileService, MockService, MusicService, SpotifyService, StdioService
Instance Method Summary collapse
-
#download(playlist_ref) ⇒ Array<Playlist>
Downloads playlists from this service.
-
#name ⇒ String
The service's internal name used to identify it.
-
#parse_ref(raw_ref) ⇒ optional, Ref
Tries to parse a ref from this service.
-
#remove(playlist_ref) ⇒ Object
Removes playlists from this service.
-
#upload(playlist_ref, playlists) ⇒ Object
Uploads playlists to this service.
Instance Method Details
#download(playlist_ref) ⇒ Array<Playlist>
Downloads playlists from this service.
32 33 34 |
# File 'lib/drum/service/service.rb', line 32 def download(playlist_ref) raise "ERROR: Service '#{self.name}' cannot download playlists (yet)!" end |
#name ⇒ String
The service's internal name used to identify it.
7 8 9 |
# File 'lib/drum/service/service.rb', line 7 def name raise "ERROR: Service does not specify a name!" end |
#parse_ref(raw_ref) ⇒ optional, Ref
Tries to parse a ref from this service.
15 16 17 |
# File 'lib/drum/service/service.rb', line 15 def parse_ref(raw_ref) nil end |
#remove(playlist_ref) ⇒ Object
Removes playlists from this service.
24 25 26 |
# File 'lib/drum/service/service.rb', line 24 def remove(playlist_ref) raise "ERROR: Service '#{self.name}' cannot remove playlists (yet)!" end |
#upload(playlist_ref, playlists) ⇒ Object
Uploads playlists to this service.
40 41 42 |
# File 'lib/drum/service/service.rb', line 40 def upload(playlist_ref, playlists) raise "ERROR: Service '#{self.name}' cannot upload playlists (yet)!" end |