timberio/timber-ruby

View on GitHub
lib/timber/log_devices/http/request_attempt.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Timber
  module LogDevices
    class HTTP
      # Represents an attempt to deliver a request. Requests can be retried, hence
      # why we keep track of the number of attempts.
      class RequestAttempt
        attr_reader :attempts, :request

        def initialize(req)
          @attempts = 0
          @request = req
        end

        def attempted!
          @attempts += 1
        end
      end
    end
  end
end