Sha256: 21d9c23c87b8cf875682214d34c29892b30eedb7966575c752b025fb8747b279

Contents?: true

Size: 1.77 KB

Versions: 5

Compression:

Stored size: 1.77 KB

Contents

module ActiveSupport
  module Cache
    module Strategy
      module LocalCache
        module LocalCacheRegistry
          def cache_for: (untyped local_cache_key) -> untyped
          def set_cache_for: (untyped local_cache_key, untyped value) -> untyped
          extend LocalCacheRegistry
        end
      end
    end
  end

  module Notifications
    interface _Callable5
      def call: (String, Time, Time, String, Hash[untyped, untyped]) -> void
    end

    interface _Callable1
      def call: (untyped event) -> void
    end

    # Subscribe to a given event name with the passed +block+.
    #
    # You can subscribe to events by passing a String to match exact event
    # names, or by passing a Regexp to match all events that match a pattern.
    #
    #   ActiveSupport::Notifications.subscribe(/render/) do |*args|
    #     @event = ActiveSupport::Notifications::Event.new(*args)
    #   end
    #
    # The +block+ will receive five parameters with information about the event:
    #
    #   ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload|
    #     name    # => String, name of the event (such as 'render' from above)
    #     start   # => Time, when the instrumented block started execution
    #     finish  # => Time, when the instrumented block ended execution
    #     id      # => String, unique ID for the instrumenter that fired the event
    #     payload # => Hash, the payload
    #   end
    #
    # If the block passed to the method only takes one parameter,
    # it will yield an event object to the block:
    #
    #   ActiveSupport::Notifications.subscribe(/render/) do |event|
    #     @event = event
    #   end
    def self.subscribe: (String | Regexp, _Callable5 | _Callable1) -> Subscriber
                      | ...
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
searchcraft-0.5.2 .gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs
searchcraft-0.5.1 .gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs
searchcraft-0.5.0 .gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs
searchcraft-0.4.2 .gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs
searchcraft-0.4.1 .gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs