Skip to content

Instantly share code, notes, and snippets.

@roykolak
Created April 1, 2009 15:39
Show Gist options
  • Save roykolak/88747 to your computer and use it in GitHub Desktop.
Save roykolak/88747 to your computer and use it in GitHub Desktop.
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