Created
July 15, 2011 02:30
-
-
Save 2no/1083922 to your computer and use it in GitHub Desktop.
無名関数によるクラス作りのための JSDoc テンプレート
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
// http://www.wakuworks.com/test/jsdoc/ | |
/** | |
* 名前空間の説明 | |
* @namespace | |
*/ | |
var Namespace = Namespace || {}; | |
/** | |
* クラスの説明など | |
* @constructor | |
* @param {String} str 引数の説明 | |
*/ | |
var Namespace.Class = Namespace.Class || (function() | |
{ | |
/** @exports Class as Namespace.Class */ | |
var PRIVATE_CONSTANT = "private"; | |
var _str = "private"; | |
/** constructor */ | |
function Class(str) | |
{ | |
this.str = str; | |
} | |
/** | |
* 定数の説明 | |
* @constant | |
* @type {String} | |
*/ | |
Class.PUBLIC_CONSTANT = "public"; | |
/** | |
* クラスメソッドの説明 | |
* @param {Number} n 引数の説明 | |
* @returns {Number} 戻り値の説明 | |
*/ | |
Class.method = function(n) | |
{ | |
return n; | |
}; | |
Class.prototype = { | |
/** | |
* インスタンス変数の説明 | |
* @type {String} | |
*/ | |
str: "", | |
/** | |
* インスタンス変数の説明 | |
* @type {String} | |
* @private | |
*/ | |
_str: "", | |
/** | |
* インスタンスメソッドの説明 | |
* @param {Number} n 引数の説明 | |
* @returns {Number} 戻り値の説明 | |
*/ | |
method: function(n) | |
{ | |
return n; | |
}, | |
/** | |
* インスタンスメソッドの説明 | |
* @param {Number} n 引数の説明 | |
* @returns {Number} 戻り値の説明 | |
* @private | |
*/ | |
_method: function(n) | |
{ | |
return n; | |
} | |
}; | |
return Class; | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment