Files
jasmine/lib/jasmine-core/example/src/Player.js
ragaskar 30431a3958 Gem-ize jasmine
[Finishes #13128217]
2011-06-17 21:01:42 -04:00

22 lines
445 B
JavaScript

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);
};