Class: Samuel::DriverPatches::HTTPClient::LoggingFilter
- Inherits:
-
Object
- Object
- Samuel::DriverPatches::HTTPClient::LoggingFilter
- Defined in:
- lib/samuel/driver_patches/http_client.rb
Instance Method Summary collapse
- #filter_request(request) ⇒ Object
- #filter_response(request, response) ⇒ Object
-
#initialize(http_client_instance) ⇒ LoggingFilter
constructor
A new instance of LoggingFilter.
Constructor Details
#initialize(http_client_instance) ⇒ LoggingFilter
Returns a new instance of LoggingFilter.
36 37 38 |
# File 'lib/samuel/driver_patches/http_client.rb', line 36 def initialize(http_client_instance) @http_client_instance = http_client_instance end |
Instance Method Details
#filter_request(request) ⇒ Object
40 41 42 |
# File 'lib/samuel/driver_patches/http_client.rb', line 40 def filter_request(request) Samuel::Diary.record_request(@http_client_instance, request) end |
#filter_response(request, response) ⇒ Object
44 45 46 47 |
# File 'lib/samuel/driver_patches/http_client.rb', line 44 def filter_response(request, response) Samuel::Diary.record_response(@http_client_instance, request, response) nil # this returns command symbols like :retry, etc. end |