Module: ActiveSupport::Notifications::Fanout::Subscribers

Defined in:
activesupport/lib/active_support/notifications/fanout.rb

Overview

:nodoc:

Defined Under Namespace

Classes: AllMessages, Evented, Timed

Class Method Summary collapse

Class Method Details

.new(pattern, listener) ⇒ Object


64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 64

def self.new(pattern, listener)
  if listener.respond_to?(:start) and listener.respond_to?(:finish)
    subscriber = Evented.new pattern, listener
  else
    subscriber = Timed.new pattern, listener
  end

  unless pattern
    AllMessages.new(subscriber)
  else
    subscriber
  end
end