module VCR::LibraryHooks::WebMock

@private

Public Instance Methods

global_hook_disabled?(request) click to toggle source
# File lib/vcr/library_hooks/webmock.rb, line 27
def global_hook_disabled?(request)
  requests = @global_hook_disabled_requests[Thread.current.object_id]
  requests && requests.include?(request)
end
global_hook_disabled_requests() click to toggle source
# File lib/vcr/library_hooks/webmock.rb, line 32
def global_hook_disabled_requests
  requests = @global_hook_disabled_requests[Thread.current.object_id]
  return requests if requests

  ObjectSpace.define_finalizer(Thread.current, lambda {
    @global_hook_disabled_requests.delete(Thread.current.object_id)
  })

  @global_hook_disabled_requests[Thread.current.object_id] = []
end
with_global_hook_disabled(request) { || ... } click to toggle source
# File lib/vcr/library_hooks/webmock.rb, line 17
def with_global_hook_disabled(request)
  global_hook_disabled_requests << request

  begin
    yield
  ensure
    global_hook_disabled_requests.delete(request)
  end
end