instrumentable.rb 471 B

1234567891011121314151617181920212223
  1. require 'active_support/notifications'
  2. module Docs
  3. module Instrumentable
  4. def self.extended(base)
  5. base.send :extend, Methods
  6. end
  7. def self.included(base)
  8. base.send :include, Methods
  9. end
  10. module Methods
  11. def instrument(*args, &block)
  12. ActiveSupport::Notifications.instrument(*args, &block)
  13. end
  14. def subscribe(*args, &block)
  15. ActiveSupport::Notifications.subscribe(*args, &block)
  16. end
  17. end
  18. end
  19. end