Skip to content

Instantly share code, notes, and snippets.

@DavidCarcamo
Created July 2, 2013 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidCarcamo/5911091 to your computer and use it in GitHub Desktop.
Save DavidCarcamo/5911091 to your computer and use it in GitHub Desktop.
Class
/**
* Creates an instance of ClassName.
* @author Author Name
*
* @constructor
* @this {ClassName}
* @param {object} The settings for this class.
* @version v.0.0.1
*/
// JSLint
/*global
VarName1:false,
varName2:false
*/
var ClassName = function(){
var constructor = function(settings){
// SETUP
var _this = this;
var defaults;
// compile settings
defaults = {};
settings = _.extend(settings || {}, defaults);
// METHODS
/**
* A public privilaged method.
*
* @this {ClassName}
*/
_this.publicPrivilaged = function(){
};
/**
* A private method.
*
* @this {ClassName}
*/
var private = function(){
};
// if auto initialize
_this.initialize();
// return instance
return _this;
};
// PROPERTIES
// Shorthand
var pro = constructor.prototype;
// Public Shared Property
pro.template = '<div></div>';
// METHODS
/**
* Public Shared method.
*
* @this {ClassName}
*/
pro.publicShared = function(){
};
return constructor;
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment