class ActiveSupport::Subscriber

def attach_to(namespace, subscriber = new, notifier = ActiveSupport::Notifications, inherit_all: false)

Attach the subscriber to a namespace.
def attach_to(namespace, subscriber = new, notifier = ActiveSupport::Notifications, inherit_all: false)
  @namespace  = namespace
  @subscriber = subscriber
  @notifier   = notifier
  @inherit_all = inherit_all
  subscribers << subscriber
  # Add event subscribers for all existing methods on the class.
  fetch_public_methods(subscriber, inherit_all).each do |event|
    add_event_subscriber(event)
  end
end