aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorGrant Hutchins & Sabrina Staedt <pair+grant+sabrina@pivotallabs.com>2012-09-27 15:37:24 -0400
committerGrant Hutchins & Sabrina Staedt <pair+grant+sabrina@pivotallabs.com>2012-09-27 15:38:54 -0400
commit5917c6eb285b0327ab340ee2933db88d5f5ba3bd (patch)
tree01a1e9e24d6523552f70be4875a635e9a62547aa /activesupport/lib/active_support
parent46f0fc6968493132da417e3e06f3c8aa09f54038 (diff)
downloadrails-5917c6eb285b0327ab340ee2933db88d5f5ba3bd.tar.gz
rails-5917c6eb285b0327ab340ee2933db88d5f5ba3bd.tar.bz2
rails-5917c6eb285b0327ab340ee2933db88d5f5ba3bd.zip
Improve documentation for subscribe block
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/notifications.rb12
1 files changed, 11 insertions, 1 deletions
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 = []
#