Class: Logtail::LogDevices::HTTP::RequestAttempt
- Inherits:
-
Object
- Object
- Logtail::LogDevices::HTTP::RequestAttempt
- Defined in:
- lib/logtail/log_devices/http/request_attempt.rb
Overview
Represents an attempt to deliver a request. Requests can be retried, hence why we keep track of the number of attempts.
Instance Attribute Summary collapse
-
#attempts ⇒ Object
readonly
Returns the value of attribute attempts.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #attempted! ⇒ Object
-
#initialize(req) ⇒ RequestAttempt
constructor
A new instance of RequestAttempt.
Constructor Details
#initialize(req) ⇒ RequestAttempt
Returns a new instance of RequestAttempt.
9 10 11 12 |
# File 'lib/logtail/log_devices/http/request_attempt.rb', line 9 def initialize(req) @attempts = 0 @request = req end |
Instance Attribute Details
#attempts ⇒ Object (readonly)
Returns the value of attribute attempts.
7 8 9 |
# File 'lib/logtail/log_devices/http/request_attempt.rb', line 7 def attempts @attempts end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
7 8 9 |
# File 'lib/logtail/log_devices/http/request_attempt.rb', line 7 def request @request end |
Instance Method Details
#attempted! ⇒ Object
14 15 16 |
# File 'lib/logtail/log_devices/http/request_attempt.rb', line 14 def attempted! @attempts += 1 end |