Skip to content

Instantly share code, notes, and snippets.

@lexander
Created June 10, 2013 20:09
Show Gist options
  • Save lexander/5751836 to your computer and use it in GitHub Desktop.
Save lexander/5751836 to your computer and use it in GitHub Desktop.
YUIDoc overloaded method example.
/**
* A test class file.
* @class TestClass
* @constructor
*/
function TestClass () {
}
/**
* Version one of the setFoo method
* @method setFoo
* @param a {string} a string value
*/
/**
* Version two of the setFoo method, takes two
* arguments.
* @method setFoo
* @param a {boolean} a boolean
* @param b {string} some string
*/
TestClass.prototype.setFoo = function () {
if(arguments.length === 1){
this._setFooOne(arguments[0]);
} else if (arguments.length === 2) {
this._setFooTwo(arguments[0], arguments[1]);
}
};
TestClass.prototype._setFooOne = function (arg) {
};
TestClass.prototype._setFooTwo = function (argA, argB) {
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment