Exception: Loqate::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Loqate::Error
- Defined in:
- lib/loqate/error.rb
Overview
Generic error returned from an API call
Instance Attribute Summary collapse
-
#cause ⇒ String
readonly
What caused the error.
-
#description ⇒ String
readonly
Descriptive information about the error.
-
#id ⇒ Integer
readonly
Unique identifier for the error.
-
#resolution ⇒ String
readonly
How to solve the error.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
private
Compare the equality of this error with
other. -
#initialize(id:, description:, cause:, resolution:) ⇒ Error
constructor
Instantiates an error.
Constructor Details
#initialize(id:, description:, cause:, resolution:) ⇒ Error
Instantiates an error
35 36 37 38 39 40 41 42 |
# File 'lib/loqate/error.rb', line 35 def initialize(id:, description:, cause:, resolution:) super(description) @id = id @cause = cause @resolution = resolution @description = description end |
Instance Attribute Details
#cause ⇒ String (readonly)
What caused the error
20 21 22 |
# File 'lib/loqate/error.rb', line 20 def cause @cause end |
#description ⇒ String (readonly)
Descriptive information about the error
14 15 16 |
# File 'lib/loqate/error.rb', line 14 def description @description end |
#id ⇒ Integer (readonly)
Unique identifier for the error
8 9 10 |
# File 'lib/loqate/error.rb', line 8 def id @id end |
#resolution ⇒ String (readonly)
How to solve the error
26 27 28 |
# File 'lib/loqate/error.rb', line 26 def resolution @resolution end |
Instance Method Details
#==(other) ⇒ Boolean
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.
Compare the equality of this error with other. Two errors are considered equal if they have the same id.
52 53 54 |
# File 'lib/loqate/error.rb', line 52 def ==(other) other.is_a?(Error) && id == other.id end |