Last active
August 29, 2015 14:07
-
-
Save naveda89/08b6b89d91c2b10aabcd to your computer and use it in GitHub Desktop.
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
class Classname | |
constructor: (@args...) -> | |
# returns itself | |
console.log regularFunction() | |
instanceMethod: (args) -> | |
"return from instanceMethod" | |
_privateInstanceMethod: () -> | |
"return from private instanceMethod" | |
@CONSTANT = "value of a constant" | |
@classMethod: (args) -> | |
"return from classMethod" | |
@_privateClassMethod: () -> | |
"return from private classMethod" | |
property: "value of an object property" | |
regularFunction = () => | |
"return from a regular old function" | |
@CONSTANT | |
regularVarialbe = "value of a regular old variable" | |
instance = new Classname | |
# console.log instance | |
# console.log instance.instanceMethod() | |
# console.log instance._privateInstanceMethod() | |
# console.log Classname.CONSTANT | |
# console.log Classname.classMethod() | |
# console.log Classname._privateClassMethod() | |
# console.log instance.property | |
# console.log regularFunction() # not defined (protected) | |
# console.log regularVariable # not defined (protected) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment