class Namely::Configuration

Attributes

http_codes_to_retry[R]

The http codes that should be retried if a request fails while returning a page in paged results. Number of times to retry specified in {#retries}. Defaults to an empty Array.

@see retries @return [Array<Integer>] the http codes to retry for a failed request

retries[RW]

Controls the number of times that a request for a page that failed while returning paged results with one of the http codes listed in {#http_codes_to_retry} will be retried before raising an exception. 0 by default.

@return [Integer] number of times to retry request.

Public Class Methods

new() click to toggle source
# File lib/namely/configuration.rb, line 28
def initialize
  @http_codes_to_retry = []
  @retries = 0
end

Public Instance Methods

http_codes_to_retry=(codes) click to toggle source

Specifies the http codes of failed GET requests encountered while paging that should be retried.

@param codes [Array<Integer>, Integer] http codes to retry

# File lib/namely/configuration.rb, line 16
def http_codes_to_retry=(codes)
  @http_codes_to_retry = Array(codes).map(&:to_int)
end