Sha256: a5236a1fcf55ab6c06aef0896c2a1c609257f6140308379832eca0d61e972e13

Contents?: true

Size: 468 Bytes

Versions: 2

Compression:

Stored size: 468 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() {
  console.log(this);
  this.currentlyPlayingSong.persistFavoriteStatus(true);
};

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
test_track-0.0.4 test/dummy/app/assets/javascripts/player.js
test_track-0.0.3 test/dummy/app/assets/javascripts/player.js