Class: ActiveUsage::Instrumentation::Subscriber
- Inherits:
-
Object
- Object
- ActiveUsage::Instrumentation::Subscriber
- Defined in:
- lib/active_usage/instrumentation/subscriber.rb
Constant Summary collapse
- ACTION_CONTROLLER_EVENT =
"process_action.action_controller"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.track(subscriptions) ⇒ Object
16 17 18 |
# File 'lib/active_usage/instrumentation/subscriber.rb', line 16 def track(subscriptions) @subscriptions = subscriptions end |
.unsubscribe_all ⇒ Object
11 12 13 14 |
# File 'lib/active_usage/instrumentation/subscriber.rb', line 11 def unsubscribe_all @subscriptions.each { |s| ActiveSupport::Notifications.unsubscribe(s) } @subscriptions = [] end |
Instance Method Details
#call ⇒ Object
21 22 23 24 |
# File 'lib/active_usage/instrumentation/subscriber.rb', line 21 def call self.class.unsubscribe_all self.class.track([subscribe_to_sql, subscribe_to_actions]) end |