Skip to content

Instantly share code, notes, and snippets.

@ms2sato
Created May 22, 2013 01:14
Show Gist options
  • Save ms2sato/5624561 to your computer and use it in GitHub Desktop.
Save ms2sato/5624561 to your computer and use it in GitHub Desktop.
動かしていないので動作しないかも。スタイルは確認できるはず。
var _ = require('underscore');
var MyClass = (function(){
function MyClass(){}
_.extend(MyClass.prototype, {
doIt : function(a, b){
console.log('doIt');
this._doProtected();
privates.doSecret.call(this, a, b);
},
_doProtected : function(){
//protected
console.log('protected');
}
});
MyClass.privates ={
doSecret: function(){
//private
console.log('private');
}
};
return MyClass;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment