Class: VCR::LibraryHooks::FakeWeb::RecursiveRequestHandler

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

Instance Attribute Summary collapse

Attributes inherited from RequestHandler

#net_http, #request, #request_body, #response_block

Instance Method Summary collapse

Methods included from VCR::Logger::Mixin

#log, #request_summary, #response_summary

Constructor Details

#initialize(request_type, stubbed_response, vcr_request, *args, &response_block) ⇒ RecursiveRequestHandler

Returns a new instance of RecursiveRequestHandler.



132
133
134
135
136
# File 'lib/vcr/library_hooks/fakeweb.rb', line 132

def initialize(request_type, stubbed_response, vcr_request, *args, &response_block)
  @request_type, @stubbed_response, @vcr_request =
   request_type,  stubbed_response,  vcr_request
  super(*args)
end

Instance Attribute Details

#stubbed_responseObject (readonly)

Returns the value of attribute stubbed_response.



130
131
132
# File 'lib/vcr/library_hooks/fakeweb.rb', line 130

def stubbed_response
  @stubbed_response
end

Instance Method Details

#handleObject



138
139
140
141
142
143
# File 'lib/vcr/library_hooks/fakeweb.rb', line 138

def handle
  set_typed_request_for_after_hook(@request_type)
  send "on_#{@request_type}_request"
ensure
  invoke_after_request_hook(@vcr_response)
end

#request_type(*args) ⇒ Object



145
146
147
# File 'lib/vcr/library_hooks/fakeweb.rb', line 145

def request_type(*args)
  @request_type
end