module VCR::Hooks

@private

Constants

FilteredHook

Public Class Methods

included(klass) click to toggle source
# File lib/vcr/util/hooks.rb, line 18
def self.included(klass)
  klass.class_eval do
    extend ClassMethods
    hooks_module = Module.new
    const_set("DefinedHooks", hooks_module)
    include hooks_module
  end
end

Public Instance Methods

clear_hooks() click to toggle source
# File lib/vcr/util/hooks.rb, line 33
def clear_hooks
  hooks.clear
end
has_hooks_for?(hook_type) click to toggle source
# File lib/vcr/util/hooks.rb, line 43
def has_hooks_for?(hook_type)
  hooks[hook_type].any?
end
hooks() click to toggle source
# File lib/vcr/util/hooks.rb, line 37
def hooks
  @hooks ||= Hash.new do |hash, hook_type|
    hash[hook_type] = []
  end
end
invoke_hook(hook_type, *args) click to toggle source
# File lib/vcr/util/hooks.rb, line 27
def invoke_hook(hook_type, *args)
  hooks[hook_type].map do |hook|
    hook.conditionally_invoke(*args)
  end
end