Well, you're going to run into trouble if both the classes you are
trying to mixin to you Person class are both implementing the same
method names, but assuming that is not the case you can use
Object.extend to mixin another set of methods when you're creating the
class. This is pretty crazy and it scares me, but I guess it works...

var Foo = {
  bar: function(){
    console.log("I am the bar method on the Foo object");
  }
};

var Hello = {
  world: function(){
    console.log("I am the world method on the Hello object");
  }
};

var FooHello = Class.create(Foo, Object.extend({
  initialize: function(){
  }
}, Hello));

var myInstance = new FooHello();
myInstance.bar();
myInstance.world();

-justin

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to