Class: VCR::Middleware::Faraday::RequestHandler
- Inherits:
-
RequestHandler
- Object
- RequestHandler
- VCR::Middleware::Faraday::RequestHandler
- Defined in:
- lib/vcr/middleware/faraday.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #handle ⇒ Object
-
#initialize(app, env) ⇒ RequestHandler
constructor
A new instance of RequestHandler.
Methods included from Logger::Mixin
#log, #request_summary, #response_summary
Constructor Details
#initialize(app, env) ⇒ RequestHandler
Returns a new instance of RequestHandler.
37 38 39 40 |
# File 'lib/vcr/middleware/faraday.rb', line 37 def initialize(app, env) @app, @env = app, env @has_on_complete_hook = false end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
36 37 38 |
# File 'lib/vcr/middleware/faraday.rb', line 36 def app @app end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
36 37 38 |
# File 'lib/vcr/middleware/faraday.rb', line 36 def env @env end |
Instance Method Details
#handle ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/vcr/middleware/faraday.rb', line 42 def handle # Faraday must be exlusive here in case another library hook is being used. # We don't want double recording/double playback. VCR.library_hooks.exclusive_hook = :faraday super ensure response = defined?(@vcr_response) ? @vcr_response : nil invoke_after_request_hook(response) unless delay_finishing? end |