Skip to content

Instantly share code, notes, and snippets.

@xsurge83
Last active December 16, 2015 02:09
Show Gist options
  • Save xsurge83/5360109 to your computer and use it in GitHub Desktop.
Save xsurge83/5360109 to your computer and use it in GitHub Desktop.
OOP Private and Public Member
MyClass= ->
prVar = 'private'
prMethod1 = ->
console.log 'prMethod'
self.pubMethod2()
public_members =
pubVar : 'public'
pubMethod1: ->
console.log 'pubMethod1'
prMethod1()
pubMethod2: ->
console.log 'pubMethod2'
return public_members
my = new MyClass()
my.pubMethod1()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment