From abe7251fd67376577dd229a29948189ba5604d6b Mon Sep 17 00:00:00 2001 From: Tristan Cavelier <tristan.cavelier@tiolive.com> Date: Fri, 21 Dec 2012 11:39:04 +0100 Subject: [PATCH] adding some docstring to command.js --- src/jio/commands/command.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/jio/commands/command.js b/src/jio/commands/command.js index 52de24e..e26423f 100644 --- a/src/jio/commands/command.js +++ b/src/jio/commands/command.js @@ -58,15 +58,28 @@ var command = function(spec, my) { return 'command'; }; + /** + * Gets the document id + * @method getDocId + * @return {string} The document id + */ that.getDocId = function () { return priv.docid.split('/')[0]; }; + + /** + * Gets the attachment id + * @method getAttachmentId + * @return {string} The attachment id + */ that.getAttachmentId = function () { return priv.docid.split('/')[1]; }; + /** - * @method getDoc returns the label of the command. - * @return {object} the document. + * Returns the label of the command. + * @method getDoc + * @return {object} The document. */ that.getDoc = function() { return priv.doc; @@ -119,11 +132,22 @@ var command = function(spec, my) { return true; }; + /** + * Check if the command can be retried. + * @method canBeRetried + * @return {boolean} The result + */ that.canBeRetried = function () { return (typeof priv.option.max_retry === 'undefined' || priv.option.max_retry === 0 || priv.tried < priv.option.max_retry); }; + + /** + * Gets the number time the command has been tried. + * @method getTried + * @return {number} The number of time the command has been tried + */ that.getTried = function() { return priv.tried; }; -- 2.30.9