319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 319
def self.new(pattern, listener, monotonic)
subscriber_class = monotonic ? MonotonicTimed : Timed
if listener.respond_to?(:start) && listener.respond_to?(:finish)
subscriber_class = Evented
else
procish = listener.respond_to?(:parameters) ? listener : listener.method(:call)
if procish.arity == 1 && procish.parameters.length == 1
subscriber_class = EventObject
end
end
subscriber_class.new(pattern, listener)
end
|