Sha256: df86cadc05ae752e78b03dabdf6332dfdb2fb5016d4cf4572c81e57779cc62c4
Contents?: true
Size: 446 Bytes
Versions: 8
Compression:
Stored size: 446 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); };
Version data entries
8 entries across 8 versions & 1 rubygems