Sha256: a47316d26722eb4ef6795779aaea4e6426e0fbc662b9feae1c8c2fccf8e0c942
Contents?: true
Size: 445 Bytes
Versions: 393
Compression:
Stored size: 445 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
393 entries across 300 versions & 29 rubygems