when using prototype and Class.create(), what's the preferred method of creating a subclass?
say I have a real simple class:
var Testing = Class.create();
Object.extend(Testing.prototype, {
initialize: function() {
...
},
...
});
would I subclass it as so?
var SubClass = Class.create();
Object.extend(Object.extend(SubCLass.prototype, Testing.prototype), {
...
});
or would I replace Testing.prototype above with new Testing() ?
The reason I ask this is because I think I've seen it both ways in
script.aculo.us, and they both appear to work, but I would think that
creating an instance of the class might not be such a good idea because it
might modify some state on the page or whatnot...
Thanks :)
-Jeremy
--
Jeremy Kitchen ++ [EMAIL PROTECTED]
http://ipaction.org/ -- defend your rights to fair use
pgp85A9J70ITK.pgp
Description: PGP signature
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
