mirror of https://github.com/freeCodeCamp/devdocs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
|