Re: [Rails-spinoffs] Re: Prototype OOP example

2005-12-26 Thread Cliff Mees
Victor, Thanks for putting that clearer (and more correctly) than I did! Object#extend does return the extended object, but also affects the first parameter ("destination") in-place, extending it without requiring the return. My initial example actually re-defined the base class in terms o

Re: [Rails-spinoffs] Prototype OOP example

2005-12-25 Thread Cliff Mees
superclass's constructor in prototype. So may anyone know how to use the "bind" function? I was wondering if it is anything related to inheritance.   Merry Christmas and happy coding to all of you.   Regards, QnA  2005/12/25, Cliff Mees <[EMAIL PROTECTED]>: Here's one approac

Re: [Rails-spinoffs] Prototype OOP example

2005-12-24 Thread Cliff Mees
Here's one approach:Labour = Class.create();Labour.prototype = {  initialize: function(name) {    this.name = name;  },  showMeYourName: function() {    alert(this.name);  }}Worker = Class.create();Worker.prototype = Object.extend(Labour.prototype, {  initialize: function(name, position) {    this.