Module: Iry::Handlers::Handler Abstract

Defined in:
lib/iry/handlers.rb

Overview

This module is abstract.

Interface for handlers of different database types

Instance Method Summary collapse

Instance Method Details

#handle(err, model) ⇒ nil, ActiveModel::Error

This method is abstract.

Returns ‘nil` if couldn’t handle the error, otherwise the ActiveModel::Error added to the model.

Parameters:

  • err (ActiveRecord::StatementInvalid)

    possible constraint error to handle

  • model (Model)

Returns:

  • (nil, ActiveModel::Error)

    ‘nil` if couldn’t handle the error, otherwise the ActiveModel::Error added to the model



17
18
# File 'lib/iry/handlers.rb', line 17

def handle(err, model)
end

#handle?(err) ⇒ Boolean

This method is abstract.

Returns true if this database handler is the correct one for this exception.

Parameters:

  • err (ActiveRecord::StatementInvalid)

    possible constraint error to handle

Returns:

  • (Boolean)

    true if this database handler is the correct one for this exception



9
10
# File 'lib/iry/handlers.rb', line 9

def handle?(err)
end