In JavaScript I'd set up a class like:
var SomeClass = (function()
{
var _this = { };
var privateVar = 'foo'
_this.publicVar = 'bar'
function privateFunction()
{
return privateVar;
}
_this.publicFunction = function()
{
return _this.publicVar;
}
return _this;
})();
This is fine as in privateFunction I can reference publicFunction by either calling SomeClass.publicFunction() or _this.publicFunction()
Now in Coffeescript I'm trying to set up my class so that I can call class functions, how do I go about this? How can I create a class in coffeescript called Foo and get a function in the class to reference another function in that class?