Exception: Hanami::Model::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hanami/model/error.rb

Overview

Default Error class

Since:

  • 0.5.1

Class Method Summary collapse

Class Method Details

.for(exception) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.7.0



15
16
17
# File 'lib/hanami/model/error.rb', line 15

def self.for(exception)
  mapping.fetch(exception.class, self).new(exception)
end

.mappingObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.7.0



27
28
29
# File 'lib/hanami/model/error.rb', line 27

def self.mapping
  @__mapping__
end

.register(external, internal) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.7.0



21
22
23
# File 'lib/hanami/model/error.rb', line 21

def self.register(external, internal)
  mapping.put_if_absent(external, internal)
end