Skip to content

Instantly share code, notes, and snippets.

@chrislloyd
Created October 15, 2010 09:05
Show Gist options
  • Save chrislloyd/627882 to your computer and use it in GitHub Desktop.
Save chrislloyd/627882 to your computer and use it in GitHub Desktop.
class Watch
# Instance property
location: 'here'
# Class property
@location: 'over there'
locate: ->
alert "I am #{@location}."
# Can alternatively use Watch.location (but constructor is preferred)
alert "But Watch is #{@constructor.location}."
swatch = new Watch()
swatch.locate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment