Commit abe7251f authored by Tristan Cavelier's avatar Tristan Cavelier

adding some docstring to command.js

parent 429f5f41
...@@ -58,15 +58,28 @@ var command = function(spec, my) { ...@@ -58,15 +58,28 @@ var command = function(spec, my) {
return 'command'; return 'command';
}; };
/**
* Gets the document id
* @method getDocId
* @return {string} The document id
*/
that.getDocId = function () { that.getDocId = function () {
return priv.docid.split('/')[0]; return priv.docid.split('/')[0];
}; };
/**
* Gets the attachment id
* @method getAttachmentId
* @return {string} The attachment id
*/
that.getAttachmentId = function () { that.getAttachmentId = function () {
return priv.docid.split('/')[1]; return priv.docid.split('/')[1];
}; };
/** /**
* @method getDoc returns the label of the command. * Returns the label of the command.
* @return {object} the document. * @method getDoc
* @return {object} The document.
*/ */
that.getDoc = function() { that.getDoc = function() {
return priv.doc; return priv.doc;
...@@ -119,11 +132,22 @@ var command = function(spec, my) { ...@@ -119,11 +132,22 @@ var command = function(spec, my) {
return true; return true;
}; };
/**
* Check if the command can be retried.
* @method canBeRetried
* @return {boolean} The result
*/
that.canBeRetried = function () { that.canBeRetried = function () {
return (typeof priv.option.max_retry === 'undefined' || return (typeof priv.option.max_retry === 'undefined' ||
priv.option.max_retry === 0 || priv.option.max_retry === 0 ||
priv.tried < priv.option.max_retry); 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() { that.getTried = function() {
return priv.tried; return priv.tried;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment