raptor-dev
Version:
Developer tools for RaptorJS
17 lines • 452 B
JavaScript
function Dog(breed) {
// Invoke the constructor of the superclass:
Dog.$super.call(this, 'dog');
this.breed = breed;
}
Dog.prototype = {
eat: function (food) {
// Invoke the "eat" method in the superclass:
Dog.$super.prototype.eat.apply(this, food);
this.bark();
},
bark: function () {
console.log('woof!');
}
};
require('raptor-util').inherit(Dog, require('./Animal'));
module.exports = Dog;