Class: HasOffersV3::Logger
- Inherits:
-
Object
- Object
- HasOffersV3::Logger
- Defined in:
- lib/hasoffersv3/logger.rb
Constant Summary collapse
- LABEL =
'[HasOffersV3]'.freeze
Instance Attribute Summary collapse
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Instance Method Summary collapse
-
#initialize(log = nil) ⇒ Logger
constructor
A new instance of Logger.
- #log_request(request, uri) ⇒ Object
- #log_response(response) ⇒ Object
Constructor Details
#initialize(log = nil) ⇒ Logger
Returns a new instance of Logger.
7 8 9 |
# File 'lib/hasoffersv3/logger.rb', line 7 def initialize(log = nil) @log = log end |
Instance Attribute Details
#log ⇒ Object (readonly)
Returns the value of attribute log.
5 6 7 |
# File 'lib/hasoffersv3/logger.rb', line 5 def log @log end |
Instance Method Details
#log_request(request, uri) ⇒ Object
11 12 13 |
# File 'lib/hasoffersv3/logger.rb', line 11 def log_request(request, uri) log_http(request, "Request: #{request.method} #{uri}") end |
#log_response(response) ⇒ Object
15 16 17 |
# File 'lib/hasoffersv3/logger.rb', line 15 def log_response(response) log_http(response, "Response: HTTP/#{response.http_version} #{response.code} #{response.}") end |