top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Class static variables in Ruby on Rails?

+1 vote
386 views

When setting the class static variables, These are shared across all the instances created.

Class A
 @@bool_var = true

 def get_bool_var
 @@bool_var
 end
end

All the instances will have this static variable, When through a controller, a user requests, Based on some logic, I set the value to false.

Is this class static variable be set to false in all the other requests from other users on a web application ?

posted May 26, 2014 by Dewang Chaudhary

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
...