Quantcast
Channel: Pragmatic Forums | Posts in topic 'Why is the class variable @@mute_regexp necessary in Chapter 5's mute_middleware.rb?'
Browsing latest articles
Browse All 6 View Live

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 Article


Why 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

Browsing latest articles
Browse All 6 View Live