Sha256: 8dd3ce4b24552d93d00bc721c0d6cdb929b368521d481526c905f6df8f7962ac
Contents?: true
Size: 472 Bytes
Versions: 183
Compression:
Stored size: 472 Bytes
Contents
function Player() { } Player.prototype.play = function(song) { this.currentlyPlayingSong = song; this.isPlaying = true; }; Player.prototype.pause = function() { this.isPlaying = false; }; Player.prototype.resume = function() { if (this.isPlaying) { throw new Error("song is already playing"); } this.isPlaying = true; }; Player.prototype.makeFavorite = function() { this.currentlyPlayingSong.persistFavoriteStatus(true); }; module.exports = Player;
Version data entries
183 entries across 167 versions & 7 rubygems