Class: NextStation::Result::Error
- Inherits:
-
Object
- Object
- NextStation::Result::Error
- Defined in:
- lib/next_station/result.rb
Overview
Structured error information.
Instance Attribute Summary collapse
-
#details ⇒ Hash
readonly
Additional error details.
-
#help_url ⇒ String?
readonly
An optional URL to help the end user resolve the error.
-
#message ⇒ String?
readonly
A human-readable message describing the error.
- #msg_keys ⇒ Hash readonly
-
#type ⇒ Symbol
readonly
The error type.
Instance Method Summary collapse
-
#initialize(type:, message: nil, help_url: nil, details: {}, msg_keys: {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(type:, message: nil, help_url: nil, details: {}, msg_keys: {}) ⇒ Error
Returns a new instance of Error.
115 116 117 118 119 120 121 |
# File 'lib/next_station/result.rb', line 115 def initialize(type:, message: nil, help_url: nil, details: {}, msg_keys: {}) @type = type @message = @help_url = help_url @details = details @msg_keys = msg_keys end |
Instance Attribute Details
#details ⇒ Hash (readonly)
Additional error details.
106 107 108 |
# File 'lib/next_station/result.rb', line 106 def details @details end |
#help_url ⇒ String? (readonly)
An optional URL to help the end user resolve the error.
100 101 102 |
# File 'lib/next_station/result.rb', line 100 def help_url @help_url end |
#message ⇒ String? (readonly)
A human-readable message describing the error.
95 96 97 |
# File 'lib/next_station/result.rb', line 95 def @message end |
#msg_keys ⇒ Hash (readonly)
108 109 110 |
# File 'lib/next_station/result.rb', line 108 def msg_keys @msg_keys end |
#type ⇒ Symbol (readonly)
The error type.
88 89 90 |
# File 'lib/next_station/result.rb', line 88 def type @type end |