Class: Savon::RequestLogger
- Inherits:
-
Object
- Object
- Savon::RequestLogger
- Defined in:
- lib/savon/request_logger.rb
Instance Method Summary collapse
-
#initialize(globals) ⇒ RequestLogger
constructor
A new instance of RequestLogger.
- #log(request, &http_request) ⇒ Object
- #log? ⇒ Boolean
- #logger ⇒ Object
Constructor Details
#initialize(globals) ⇒ RequestLogger
Returns a new instance of RequestLogger.
6 7 8 |
# File 'lib/savon/request_logger.rb', line 6 def initialize(globals) @globals = globals end |
Instance Method Details
#log(request, &http_request) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/savon/request_logger.rb', line 10 def log(request, &http_request) log_request(request) if log? response = http_request.call log_response(response) if log? response end |
#log? ⇒ Boolean
22 23 24 |
# File 'lib/savon/request_logger.rb', line 22 def log? @globals[:log] end |
#logger ⇒ Object
18 19 20 |
# File 'lib/savon/request_logger.rb', line 18 def logger @globals[:logger] end |