module Quovo::Hook

Public Instance Methods

clear_hooks!() click to toggle source
# File lib/quovo/hook.rb, line 11
def clear_hooks!
  @hooks = []
end
hook(&callback) click to toggle source
# File lib/quovo/hook.rb, line 3
def hook(&callback)
  hooks << callback
end
hooks() click to toggle source
# File lib/quovo/hook.rb, line 7
def hooks
  @hooks ||= []
end
run_hooks!(*args) click to toggle source
# File lib/quovo/hook.rb, line 15
def run_hooks!(*args)
  log_params = (args << Quovo.current_scope)
  hooks.each do |hook|
    hook.call(*log_params)
  end
  :ok
end