Class: RspecApiDocumentation::RequestSaver
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- RspecApiDocumentation::RequestSaver
- Defined in:
- lib/rspec_api_documentation/http_test_client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, client) ⇒ RequestSaver
constructor
A new instance of RequestSaver.
Constructor Details
#initialize(app, client) ⇒ RequestSaver
Returns a new instance of RequestSaver.
13 14 15 16 |
# File 'lib/rspec_api_documentation/http_test_client.rb', line 13 def initialize(app, client) super(app) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/rspec_api_documentation/http_test_client.rb', line 11 def client @client end |
Instance Method Details
#call(env) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/rspec_api_documentation/http_test_client.rb', line 18 def call(env) client.last_request = env @app.call(env).on_complete do |env| client.last_response = env end end |