Class: Logtail::LogDevices::HTTP::RequestAttempt

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#attemptsObject (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

#requestObject (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