class ShopifyTheme::APIChecker::APIResult

Constants

OK
SERVER_ERROR_CODES
UNAUTHORIZED

Attributes

response[R]

Public Class Methods

new(http_response) click to toggle source
# File lib/shopify_theme/api_checker.rb, line 9
def initialize(http_response)
  @response = http_response
end

Public Instance Methods

accessed_api?() click to toggle source
# File lib/shopify_theme/api_checker.rb, line 13
def accessed_api?
  response.code == OK
end
api_down?() click to toggle source
# File lib/shopify_theme/api_checker.rb, line 25
def api_down?
  SERVER_ERROR_CODES.include?(response.code)
end
cannot_access_api?() click to toggle source
# File lib/shopify_theme/api_checker.rb, line 17
def cannot_access_api?
  !accessed_api?
end
invalid_config?() click to toggle source
# File lib/shopify_theme/api_checker.rb, line 21
def invalid_config?
  response.code == UNAUTHORIZED
end