Because any properties/methods outside of "initialize" are shared via
prototype chain among all instances of a class.

- kangax

On May 13, 1:24 pm, Rauan Maemirov <[EMAIL PROTECTED]> wrote:
> Hi, all.
>
> I have class that created this way:
>
> var MyClass = Class.create();
> MyClass.prototype = {
>     myVar: {},
> ...}
>
> in this class i use it as this.myVar. So, when I create two instances
> of this class, first instance use values from second and vice-verse.
> Why? As U can see it's not singleton.
--~--~---------~--~----~------------~-------~--~----~
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