Module: Eloquant::Errors

Defined in:
lib/eloquant/errors.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

Unknown =
create_class
EmptyResponse =
create_class
AuthorizationError =
create_class
BulkExportCreationError =
create_class
RESPONSE_CODE_TO_ERROR =
{}.freeze

Class Method Summary collapse

Class Method Details

.create_classObject



6
7
8
# File 'lib/eloquant/errors.rb', line 6

def self.create_class
  Class.new(Error)
end

.find_by_response_code(response_code) ⇒ Object



21
22
23
# File 'lib/eloquant/errors.rb', line 21

def self.find_by_response_code(response_code)
  const_get(RESPONSE_CODE_TO_ERROR.fetch(response_code, "Error"))
end