class Knowtify::Response

Constants

ERROR_HTTP_CODES

Attributes

body[RW]
count[RW]
http_code[RW]
raw_response[RW]

Public Class Methods

new(count=0) click to toggle source
# File lib/knowtify/response.rb, line 10
def initialize(count=0)
  @count = count || 0
end

Public Instance Methods

authentication_error?() click to toggle source
# File lib/knowtify/response.rb, line 26
def authentication_error?
  http_code == 401
end
retried?() click to toggle source
# File lib/knowtify/response.rb, line 18
def retried?
  count != 0
end
retry?() click to toggle source
# File lib/knowtify/response.rb, line 14
def retry?
  (((count + 1) <= Knowtify.config.max_retries) && ERROR_HTTP_CODES.include?(http_code))
end
successful?() click to toggle source
# File lib/knowtify/response.rb, line 22
def successful?
  http_code == 200
end