Class: Halt::Error Private
- Inherits:
-
Object
- Object
- Halt::Error
- Defined in:
- lib/halt/error.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Error object to house the translation logic and exception/status information passed in when halt has been called or an exception is being rescued.
Constant Summary collapse
- MESSAGES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'halt.errors.messages'.freeze
- DESCRIPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'halt.errors.descriptions'.freeze
Instance Attribute Summary collapse
- #description ⇒ String private
- #exception ⇒ Object private
- #message ⇒ String private
- #status ⇒ Object private
Instance Method Summary collapse
- #attributes ⇒ Hash private
-
#initialize(status, exception: nil, message: nil, description: nil) ⇒ Error
constructor
private
A new instance of Error.
Constructor Details
#initialize(status, exception: nil, message: nil, description: nil) ⇒ Error
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.
Returns a new instance of Error.
24 25 26 27 28 29 |
# File 'lib/halt/error.rb', line 24 def initialize(status, exception: nil, message: nil, description: nil) @status = status @exception = exception @message = @description = description end |
Instance Attribute Details
#description ⇒ String
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.
37 38 39 |
# File 'lib/halt/error.rb', line 37 def description @description ||= translate DESCRIPTIONS end |
#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.
15 16 17 |
# File 'lib/halt/error.rb', line 15 def exception @exception end |
#message ⇒ String
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.
32 33 34 |
# File 'lib/halt/error.rb', line 32 def @message ||= translate MESSAGES end |
#status ⇒ 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.
14 15 16 |
# File 'lib/halt/error.rb', line 14 def status @status end |
Instance Method Details
#attributes ⇒ Hash
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.
42 43 44 45 46 47 48 |
# File 'lib/halt/error.rb', line 42 def attributes { status: status, message: , description: description } end |