Exception: SaasRunner::ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- SaasRunner::ResponseError
- Defined in:
- lib/saas_runner/response_error.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 = nil) ⇒ ResponseError
constructor
A new instance of ResponseError.
- #to_s ⇒ Object
Constructor Details
#initialize(response = nil) ⇒ ResponseError
Returns a new instance of ResponseError.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/saas_runner/response_error.rb', line 5 def initialize(response = nil) @response = response @body = response[:body] @status = response[:status].to_i @method = response[:method].to_s.upcase @url = response[:url] super end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/saas_runner/response_error.rb', line 3 def body @body end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/saas_runner/response_error.rb', line 3 def method @method end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/saas_runner/response_error.rb', line 3 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/saas_runner/response_error.rb', line 3 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/saas_runner/response_error.rb', line 3 def url @url end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/saas_runner/response_error.rb', line 16 def to_s "#{status} #{method} #{url} | Errors: #{errors}" end |