def ("Person") ({
init: function(name){
this.name = name;
},
speak: function(text){
alert(text || "Hi, my name is " + this.name);
}
});
def ("Ninja") << Person ({
init: function(name){
this._super();
},
kick: function(){
this.speak("I kick u!");
}
});
var ninjy = new Ninja("JDD");
ninjy.speak();
ninjy.kick();
-
Notifications
You must be signed in to change notification settings - Fork 15
Simple Ruby-style inheritance for JavaScript
License
tbtlr/def.js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simple Ruby-style inheritance for JavaScript
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published