Exception: ExternalServices::Api::Error
- Inherits:
-
StandardError
- Object
- StandardError
- ExternalServices::Api::Error
- Defined in:
- lib/external_services/api.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/external_services/api.rb', line 10 def initialize(response) @response = response if response.respond_to?(:env) @status = response.status @url = response.env.url.to_s @method = response.env.method.to_s.upcase @body = response.body end super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/external_services/api.rb', line 8 def body @body end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/external_services/api.rb', line 8 def method @method end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/external_services/api.rb', line 8 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/external_services/api.rb', line 8 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/external_services/api.rb', line 8 def url @url end |