The revised (OO) AnalyticsService has an SRP violation. It knows:
- How to capture analytics
- When it should and shouldn't turn itself off
A more OO approach would to remove the second responsibilty and have something like the above where you have an that is object repsonsible for configuration.
I like to make use of the 'null object' pattern in these scenarios where I have a an innocuous object, in this case a service, that that doesn't do anything.
If that seems heavy weight, it is more ceremony than the typical Rails way but having the interface on services be #call we can substitute the NullAnalyticsService for a lambda, elimating the need for another object.