import jasmine-standalone-1.3.1.zip
[mkws-moved-to-github.git] / examples / jasmine / src / Player.js
diff --git a/examples/jasmine/src/Player.js b/examples/jasmine/src/Player.js
new file mode 100644 (file)
index 0000000..fcce826
--- /dev/null
@@ -0,0 +1,22 @@
+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);
+};
\ No newline at end of file