Code coverage report for api/audio_video/AudioVideos.js

Statements: 64.29% (9 / 14)      Branches: 12.5% (1 / 8)      Functions: 50% (1 / 2)      Lines: 64.29% (9 / 14)      Ignored: none     

All files » api/audio_video/ » AudioVideos.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 501 1                     1 1209 1209   1209 1209     1                                                       1  
var Collection = require("./../Collection").Collection;
var AudioVideo = require("./AudioVideo").AudioVideo;
 
/**
 * @class AudioVideos is a minimal customization of the Collection
 * to add an internal model of AudioVideo.
 *
 * @name  AudioVideos
 *
 * @extends Collection
 * @constructs
 */
var AudioVideos = function AudioVideos(options) {
  Eif (!this._fieldDBtype) {
    this._fieldDBtype = "AudioVideos";
  }
  this.debug("Constructing AudioVideos length: ", options);
  Collection.apply(this, arguments);
};
 
AudioVideos.prototype = Object.create(Collection.prototype, /** @lends AudioVideos.prototype */ {
  constructor: {
    value: AudioVideos
  },
 
  primaryKey: {
    value: "URL"
  },
 
  INTERNAL_MODELS: {
    value: {
      item: AudioVideo
    }
  },
 
  play: {
    value: function(optionalIndexToPlay) {
      this.debug("playing collection");
      if (!optionalIndexToPlay) {
        optionalIndexToPlay = 0;
      }
      if (this._collection && this._collection[optionalIndexToPlay]) {
        this._collection[optionalIndexToPlay].play();
      }
    }
  }
 
});
exports.AudioVideos = AudioVideos;