Module: Datadog::Contrib::ActiveSupport::Notifications::Event

Defined in:
lib/ddtrace/contrib/active_support/notifications/event.rb

Overview

Defines behaviors for an ActiveSupport::Notifications event. Compose this into a module or class, then define #event_name, #span_name, and #process. You can then invoke Event.subscribe! to more easily subscribe to an event.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



12
13
14
15
16
# File 'lib/ddtrace/contrib/active_support/notifications/event.rb', line 12

def self.included(base)
  base.send(:include, Subscriber)
  base.send(:extend, ClassMethods)
  base.send(:on_subscribe) { base.subscribe }
end