Skip to content

Commit 5917c6e

Browse files
author
Grant Hutchins & Sabrina Staedt
committed
Improve documentation for subscribe block
1 parent 46f0fc6 commit 5917c6e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

activesupport/lib/active_support/notifications.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ module ActiveSupport
2525
# == Subscribers
2626
#
2727
# You can consume those events and the information they provide by registering
28-
# a subscriber. For instance, let's store all "render" events in an array:
28+
# a subscriber.
29+
#
30+
# ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload|
31+
# name # => String, name of the event (such as 'render' from above)
32+
# start # => Time, when the instrumented block started execution
33+
# finish # => Time, when the instrumented block ended execution
34+
# id # => String, unique ID for this notification
35+
# payload # => Hash, the payload
36+
# end
37+
#
38+
# For instance, let's store all "render" events in an array:
2939
#
3040
# events = []
3141
#

0 commit comments

Comments
 (0)