mySuperClass.prototype =
{
initialize: function(id)
{
doSomething: function()
{
};{
this.id = id;
},doSomething: function()
{
alert(this.id + " base doSomething()");
}mySubClass = Class.create();
mySubClass.prototype =
{
initialize: function(id)
{
};{
//cache the base class instance
this.base = new mySuperClass(id);
//inherit from the base class
Object.extend (this, this.base);
//override methods
this.doSomething = function()
{
};
}this.base = new mySuperClass(id);
//inherit from the base class
Object.extend (this, this.base);
//override methods
this.doSomething = function()
{
};
On 9/12/06, Sébastien Gruhier <[EMAIL PROTECTED]> wrote:
Hi
Is there a way to extend a class and to overide a method and, in this
method, to call the parent function as it is done in mootools?
Thanks
Seb
Athena Group, Inc.
Inquire: 1-888-919-8700 x2903
Blog: http://www.someElement.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---
- [Rails-spinoffs] inheritance and parent Sébastien Gruhier
- [Rails-spinoffs] Re: inheritance and parent Ryan Gahl
- [Rails-spinoffs] Re: inheritance and parent Peter Michaux
- [Rails-spinoffs] Re: inheritance and parent Sébastien Gruhier
