There is one problem in this approach. In Animal, name and sound are
the named properties which is not part of Animal.prototype, but they
becomes prototype properties in Dog class, so if you create many
different dogs from Dog class, all dogs will share the one name and
sound properties, which means if you change the name in one dog, then
all the other dogs will get the same name. The prototype Object.extend
is mainly for extending property and not good for implementing
inheritance.

On Feb 23, 1:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Thanks. I saw the result now after this changes. I realize that name
> also need to change to this.name.


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to