ensl_gathers/lib/chat/message.js

19 lines
326 B
JavaScript
Raw Normal View History

2015-07-21 14:10:24 +00:00
"use strict";
2015-07-22 13:53:50 +00:00
var Author = require("./author");
2015-07-21 14:10:24 +00:00
function Message (o) {
this.author = Author(o.author);
this.content = o.content;
this.createdAt = new Date();
};
Message.prototype.toJson = function () {
return {
2015-07-22 23:30:14 +00:00
author: this.author,
2015-07-21 14:10:24 +00:00
content: this.content,
createdAt: this.createdAt
}
};
module.exports = Message;