Created
April 1, 2009 15:39
-
-
Save roykolak/88747 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
var Person = Micro.extend(function(name) { | |
this.name = name; | |
}); | |
Person.include({ | |
greet: function() { | |
print('Hello, ' + this.name + '!'); | |
} | |
}); | |
var bob = new Person('Bob Sled'); | |
print(bob.name); | |
bob.greet(); | |
var Pirate = Person.extend(function(name, eyePatch) { | |
this.zuper(name); | |
this.eyePatch = eyePatch; | |
}); | |
Pirate.include({ | |
greet: function() { | |
this.zuper(); | |
print('Ahoy, ' + this.name + '!'); | |
} | |
}); | |
var hook = new Pirate('Captain Hook', true); | |
print(hook.name); | |
print(hook.eyePatch); | |
hook.greet(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment