Created
June 10, 2013 20:09
-
-
Save lexander/5751836 to your computer and use it in GitHub Desktop.
YUIDoc overloaded method example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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