Created
May 1, 2012 14:53
-
-
Save mbolt35/2568518 to your computer and use it in GitHub Desktop.
CoffeeScript Global Class
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
# Defining a class globally can be done like this: | |
class Foo | |
constructor: (@name) -> | |
this.Foo = Foo; | |
# Or like this... | |
this.Foo = class Foo | |
constructor: (@name) -> | |
# Or like this... | |
class this.Foo | |
constructor: (@name) -> | |
# Or my personal favorite... | |
class @Foo | |
constructor: (@name) -> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment