Flowdock
method

new

Importance_0
v6.1.3.1 - Show latest stable - 0 notes - Class: Subscribers
new(pattern, listener, monotonic) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/notifications/fanout.rb, line 88
        def self.new(pattern, listener, monotonic)
          subscriber_class = monotonic ? MonotonicTimed : Timed

          if listener.respond_to?(:start) && listener.respond_to?(:finish)
            subscriber_class = Evented
          else
            # Doing all this to detect a block like `proc { |x| }` vs
            # `proc { |*x| }` or `proc { |**x| }`
            if listener.respond_to?(:parameters)
              params = listener.parameters
              if params.length == 1 && params.first.first == :opt
                subscriber_class = EventObject
              end
            end
          end

          wrap_all pattern, subscriber_class.new(pattern, listener)
        end
Register or log in to add new notes.