Class: VCR::LibraryHooks::FakeWeb::RequestHandler

Inherits:
RequestHandler show all
Defined in:
lib/vcr/library_hooks/fakeweb.rb

Direct Known Subclasses

RecursiveRequestHandler

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from VCR::Logger::Mixin

#log, #request_summary, #response_summary

Constructor Details

#initialize(net_http, request, request_body = nil, &response_block) ⇒ RequestHandler

Returns a new instance of RequestHandler.



17
18
19
20
21
# File 'lib/vcr/library_hooks/fakeweb.rb', line 17

def initialize(net_http, request, request_body = nil, &response_block)
  @net_http, @request, @request_body, @response_block =
   net_http,  request,  request_body,  response_block
  @stubbed_response, @vcr_response, @recursing = nil, nil, false
end

Instance Attribute Details

#net_httpObject (readonly)

Returns the value of attribute net_http.



16
17
18
# File 'lib/vcr/library_hooks/fakeweb.rb', line 16

def net_http
  @net_http
end

#requestObject (readonly)

Returns the value of attribute request.



16
17
18
# File 'lib/vcr/library_hooks/fakeweb.rb', line 16

def request
  @request
end

#request_bodyObject (readonly)

Returns the value of attribute request_body.



16
17
18
# File 'lib/vcr/library_hooks/fakeweb.rb', line 16

def request_body
  @request_body
end

#response_blockObject (readonly)

Returns the value of attribute response_block.



16
17
18
# File 'lib/vcr/library_hooks/fakeweb.rb', line 16

def response_block
  @response_block
end

Instance Method Details

#handleObject



23
24
25
26
27
# File 'lib/vcr/library_hooks/fakeweb.rb', line 23

def handle
  super
ensure
  invoke_after_request_hook(@vcr_response) unless @recursing
end