mirror of https://github.com/freeCodeCamp/devdocs
24 lines
471 B
24 lines
471 B
![]()
11 years ago
|
require 'active_support/notifications'
|
||
|
|
||
|
module Docs
|
||
|
module Instrumentable
|
||
|
def self.extended(base)
|
||
|
base.send :extend, Methods
|
||
|
end
|
||
|
|
||
|
def self.included(base)
|
||
|
base.send :include, Methods
|
||
|
end
|
||
|
|
||
|
module Methods
|
||
|
def instrument(*args, &block)
|
||
|
ActiveSupport::Notifications.instrument(*args, &block)
|
||
|
end
|
||
|
|
||
|
def subscribe(*args, &block)
|
||
|
ActiveSupport::Notifications.subscribe(*args, &block)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|