Exception: PreventGo::ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- PreventGo::ResponseError
- Defined in:
- lib/prevent_go/response_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#request_url ⇒ Object
readonly
Returns the value of attribute request_url.
Instance Method Summary collapse
-
#initialize(request_url, code, details) ⇒ ResponseError
constructor
A new instance of ResponseError.
- #message ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(request_url, code, details) ⇒ ResponseError
Returns a new instance of ResponseError.
5 6 7 8 9 10 11 12 |
# File 'lib/prevent_go/response_error.rb', line 5 def initialize(request_url, code, details) @request_url, @code, @details = request_url, code, details @details['Code'] = code @details['Url'] = request_url.request_uri super() if end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/prevent_go/response_error.rb', line 3 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
3 4 5 |
# File 'lib/prevent_go/response_error.rb', line 3 def details @details end |
#request_url ⇒ Object (readonly)
Returns the value of attribute request_url.
3 4 5 |
# File 'lib/prevent_go/response_error.rb', line 3 def request_url @request_url end |
Instance Method Details
#message ⇒ Object
18 19 20 |
# File 'lib/prevent_go/response_error.rb', line 18 def @details.dig('error', 'message') end |
#type ⇒ Object
14 15 16 |
# File 'lib/prevent_go/response_error.rb', line 14 def type @details.dig('error', 'code') end |