Skip to content

Instantly share code, notes, and snippets.

@sbellity
Created November 18, 2011 11:36
Show Gist options
  • Save sbellity/1376230 to your computer and use it in GitHub Desktop.
Save sbellity/1376230 to your computer and use it in GitHub Desktop.
privated methods in coffeescript
class AnotherClass
constructor: ->
console.warn("YEAH !")
exports.AnotherClass = AnotherClass
#= require another_class
AnotherClass = exports.AnotherClass
myPrivateMethod = ->
console.warn("This:", @)
class MyClass
init: (name)->
console.warn("In my class")
@name = name
@a_friend = new AnotherClass
myPrivateMethod.apply(this)
exports.MyClass = MyClass
//= require wrap-start
//= require my_class
//= require another_class
//= require wrap-end
(function() {
var exports = {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment