2b15dd764ad645ce616621ff10099e170bfb7f0b
[aai/esr-gui.git] /
1 "use strict";
2
3 /**
4  * Creates a new CommandResult instance
5  * @class
6  * @param {object} result CommandResult object
7  * @param {Connection} connection A connection instance associated with this result
8  * @return {CommandResult} A cursor instance
9  */
10 var CommandResult = function(result, connection, message) {
11   this.result = result;
12   this.connection = connection;
13   this.message = message;
14 }
15
16 /**
17  * Convert CommandResult to JSON
18  * @method
19  * @return {object}
20  */
21 CommandResult.prototype.toJSON = function() {
22   return this.result;
23 }
24
25 /**
26  * Convert CommandResult to String representation
27  * @method
28  * @return {string}
29  */
30 CommandResult.prototype.toString = function() {
31   return JSON.stringify(this.toJSON());
32 }
33
34 module.exports = CommandResult;