Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update activesupport/7.0 #371

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions gems/activesupport/7.0/activesupport-7.0.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,42 @@ module ActiveSupport
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