Last active
August 29, 2015 14:01
-
-
Save weslleyaraujo/cdb03c878516f1dccb14 to your computer and use it in GitHub Desktop.
Pattern for private methods using prototype
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
var ClassName = (function () { | |
var | |
// here is the place to inject private methods | |
_private = {}, | |
// all attributes values goes here | |
attributes = { | |
}; | |
function ClassName (args) { | |
args = args || {}; | |
this.initialize(args); | |
} | |
_private = { | |
}; | |
ClassName.prototype.initialize = function (args) { | |
this.args = args; | |
this.set(); | |
}; | |
ClassName.prototype.set = function () { | |
}; | |
return ClassName; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment