Code coverage report for api/comment/Comments.js

Statements: 81.82% (9 / 11)      Branches: 50% (1 / 2)      Functions: 50% (1 / 2)      Lines: 81.82% (9 / 11)      Ignored: none     

All files » api/comment/ » Comments.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 461 1                       1 98 98   98 98     1                                             1  
var Collection = require("./../Collection").Collection;
var Comment = require("./Comment").Comment;
 
/**
 * @class
 
 * @name  Comments
 * @description The Comments is a minimal customization of the Collection
 * to add an internal model of Comment.
 *
 * @extends Collection
 * @constructs
 */
var Comments = function Comments(options) {
  Eif (!this._fieldDBtype) {
    this._fieldDBtype = "Comments";
  }
  this.debug("Constructing Comments ", options);
  Collection.apply(this, arguments);
};
 
Comments.prototype = Object.create(Collection.prototype, /** @lends Comments.prototype */ {
  constructor: {
    value: Comments
  },
 
  primaryKey: {
    value: "timestamp"
  },
 
  INTERNAL_MODELS: {
    value: {
      item: Comment
    }
  },
 
  insertNewCommentFromObject: {
    value: function(commentObject) {
      commentObject.timestamp = Date.now();
      this.add(new Comment(commentObject));
    }
  }
 
});
exports.Comments = Comments;