Skip to content

Instantly share code, notes, and snippets.

@mbolt35
Created May 1, 2012 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbolt35/2568518 to your computer and use it in GitHub Desktop.
Save mbolt35/2568518 to your computer and use it in GitHub Desktop.
CoffeeScript Global Class
# 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