lib/active_support/notifications/instrumenter.rb in activesupport-5.0.7.2 vs lib/active_support/notifications/instrumenter.rb in activesupport-5.1.0.beta1

- old
+ new

@@ -1,6 +1,6 @@ -require 'securerandom' +require "securerandom" module ActiveSupport module Notifications # Instrumenters are stored in a thread local. class Instrumenter @@ -12,11 +12,11 @@ end # Instrument the given block by measuring the time taken to execute it # and publish it. Notice that events get sent even if an error occurs # in the passed-in block. - def instrument(name, payload={}) + def instrument(name, payload = {}) # some of the listeners might have state listeners_state = start name, payload begin yield payload rescue Exception => e @@ -42,12 +42,12 @@ @notifier.finish name, @id, payload, listeners_state end private - def unique_id - SecureRandom.hex(10) - end + def unique_id + SecureRandom.hex(10) + end end class Event attr_reader :name, :time, :transaction_id, :payload, :children attr_accessor :end