instance method dispatch

Ruby on Rails 8.1.2

Since v7.1.6 Private

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

dispatch(method, *args, **kwargs, &block)

No documentation comment.

Parameters

method req
args rest
kwargs keyrest
block block
Source
# File activesupport/lib/active_support/broadcast_logger.rb, line 202
      def dispatch(method, *args, **kwargs, &block)
        if block_given?
          # Maintain semantics that the first logger yields the block
          # as normal, but subsequent loggers won't re-execute the block.
          # Instead, the initial result is immediately returned.
          called, result = false, nil
          block = proc { |*args, **kwargs|
            if called then result
            else
              called = true
              result = yield(*args, **kwargs)
            end
          }
        end

        @broadcasts.map { |logger|
          logger.send(method, *args, **kwargs, &block)
        }.first
      end

Defined in activesupport/lib/active_support/broadcast_logger.rb line 202 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::BroadcastLogger

Type at least 2 characters to search.

↑↓ navigate · open · esc close