class Eclaircir::Status

Constants

API_KEY_NOT_FOUND
BAD_REQUEST_FORMAT
DUPLICATE_URL
ERRORS_MAPPINGS
FAILURE
IMAGE_DECODING_FAILED
INVALID_AUTH_TOKEN
INVALID_REQUEST
SUCCESS

statuses

Public Instance Methods

success?() click to toggle source
# File lib/eclaircir/api_models/status.rb, line 10
def success?
  code == SUCCESS
end
validate!() click to toggle source
# File lib/eclaircir/api_models/status.rb, line 14
def validate!
  unless success?
    error_class = ERRORS_MAPPINGS.fetch(code, APIError)
    raise error_class, description
  end

  true
end