From 5917c6eb285b0327ab340ee2933db88d5f5ba3bd Mon Sep 17 00:00:00 2001 From: Grant Hutchins & Sabrina Staedt Date: Thu, 27 Sep 2012 15:37:24 -0400 Subject: Improve documentation for subscribe block --- activesupport/lib/active_support/notifications.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb index aefba1c4f5..099117cebb 100644 --- a/activesupport/lib/active_support/notifications.rb +++ b/activesupport/lib/active_support/notifications.rb @@ -25,7 +25,17 @@ module ActiveSupport # == Subscribers # # You can consume those events and the information they provide by registering - # a subscriber. For instance, let's store all "render" events in an array: + # a subscriber. + # + # 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 this notification + # payload # => Hash, the payload + # end + # + # For instance, let's store all "render" events in an array: # # events = [] # -- cgit v1.2.3