import jasmine-standalone-1.3.1.zip
[mkws-moved-to-github.git] / examples / jasmine / src / Player.js
1 function Player() {
2 }
3 Player.prototype.play = function(song) {
4   this.currentlyPlayingSong = song;
5   this.isPlaying = true;
6 };
7
8 Player.prototype.pause = function() {
9   this.isPlaying = false;
10 };
11
12 Player.prototype.resume = function() {
13   if (this.isPlaying) {
14     throw new Error("song is already playing");
15   }
16
17   this.isPlaying = true;
18 };
19
20 Player.prototype.makeFavorite = function() {
21   this.currentlyPlayingSong.persistFavoriteStatus(true);
22 };