↧
Why is the class variable @@mute_regexp necessary in Chapter 5's...
In sql_metrics/lib/sql_metrics/mute_middleware.rb (page 113), a class variable was used in the module definition:mattr_accessor :mute_regexp@@mute_regexp = nilWould a class instance variable...
View ArticleWhy is the class variable @@mute_regexp necessary in Chapter 5's...
We use a class variable for simplicity as it is easy to access both from the class and instance levels. Using a class or instance variable should not affect thread safety.
View Article