-
-
Save boj/627917 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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