Class: Fulfillment::ServiceError
Overview
Service errors
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(response_body = {}) ⇒ ServiceError
constructor
A new instance of ServiceError.
- #message ⇒ Object (also: #to_s)
- #status ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(response_body = {}) ⇒ ServiceError
Returns a new instance of ServiceError.
12 13 14 |
# File 'lib/fulfillment/errors.rb', line 12 def initialize(response_body = {}) @error = response_body.fetch("error", {}) if response_body end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
10 11 12 |
# File 'lib/fulfillment/errors.rb', line 10 def error @error end |
Instance Method Details
#message ⇒ Object Also known as: to_s
16 17 18 |
# File 'lib/fulfillment/errors.rb', line 16 def error&.dig("message") end |
#status ⇒ Object
21 22 23 |
# File 'lib/fulfillment/errors.rb', line 21 def status error&.dig("status") end |
#type ⇒ Object
25 26 27 |
# File 'lib/fulfillment/errors.rb', line 25 def type error&.dig("type") end |