Exception: Vhx::VhxError
- Inherits:
-
StandardError
- Object
- StandardError
- Vhx::VhxError
- Defined in:
- lib/vhx/error.rb
Direct Known Subclasses
BadRequestError, InvalidTokenError, NotAcceptableError, NotFoundError, PaymentRequiredError, ServerError, UnauthorizedError
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#response_status ⇒ Object
readonly
Returns the value of attribute response_status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(response_body, response_status, url) ⇒ VhxError
constructor
A new instance of VhxError.
Constructor Details
#initialize(response_body, response_status, url) ⇒ VhxError
Returns a new instance of VhxError.
5 6 7 8 9 10 11 12 |
# File 'lib/vhx/error.rb', line 5 def initialize(response_body, response_status, url) @response_body = response_body @response_status = response_status @url = url @message = response_body.is_a?(Hash) ? response_body['message'] : response_body.to_s super(@message) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/vhx/error.rb', line 3 def @message end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
3 4 5 |
# File 'lib/vhx/error.rb', line 3 def response_body @response_body end |
#response_status ⇒ Object (readonly)
Returns the value of attribute response_status.
3 4 5 |
# File 'lib/vhx/error.rb', line 3 def response_status @response_status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/vhx/error.rb', line 3 def url @url end |