Exception: CoverMyMeds::Error::HTTPError
- Inherits:
-
StandardError
- Object
- StandardError
- CoverMyMeds::Error::HTTPError
- Defined in:
- lib/cover_my_meds/error.rb
Instance Attribute Summary collapse
-
#error_json ⇒ Object
readonly
Returns the value of attribute error_json.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(status, message, http_method, url) ⇒ HTTPError
constructor
A new instance of HTTPError.
- #message ⇒ Object
Constructor Details
#initialize(status, message, http_method, url) ⇒ HTTPError
Returns a new instance of HTTPError.
5 6 7 8 9 10 |
# File 'lib/cover_my_meds/error.rb', line 5 def initialize status, , http_method, url @status = status @error_json = @http_method = http_method @url = url end |
Instance Attribute Details
#error_json ⇒ Object (readonly)
Returns the value of attribute error_json.
20 21 22 |
# File 'lib/cover_my_meds/error.rb', line 20 def error_json @error_json end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
20 21 22 |
# File 'lib/cover_my_meds/error.rb', line 20 def http_method @http_method end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
20 21 22 |
# File 'lib/cover_my_meds/error.rb', line 20 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
20 21 22 |
# File 'lib/cover_my_meds/error.rb', line 20 def url @url end |
Instance Method Details
#message ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/cover_my_meds/error.rb', line 12 def " \#{@status}: \#{@error_json}\n in response to:\n \#{@http_method.upcase} \#{@url}\n EOS\nend\n".gsub(/^ {10}/, "") |