Skip to content
This repository
Browse code

Improve documentation for subscribe block

  • Loading branch information...
commit 5917c6eb285b0327ab340ee2933db88d5f5ba3bd 1 parent 46f0fc6
authored
12  activesupport/lib/active_support/notifications.rb
@@ -25,7 +25,17 @@ module ActiveSupport
25 25
   # == Subscribers
26 26
   #
27 27
   # 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:
29 39
   #
30 40
   #   events = []
31 41
   #

0 notes on commit 5917c6e

Please sign in to comment.
Something went wrong with that request. Please try again.