I''m trying to use a class level variable @@count as a counter between requests to the server. So for example I initialize it @@count = 0 at the top of the class and in a method I have @@count = @@count+1. It seems though that @@count is begin reinitialized back to 0 each time the controller is called. Is there something that I''m missing here? I''m running under mongrel on Linux. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kris Kohlstedt wrote:> I''m trying to use a class level variable @@count as a counter between > requests to the server. So for example I initialize it @@count = 0 at > the top of the class and in a method I have @@count = @@count+1. It > seems though that @@count is begin reinitialized back to 0 each time the > controller is called. Is there something that I''m missing here? I''m > running under mongrel on Linux.Well for every request to the server you would get a new class variable :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---