Exception: LineChange::APIError
- Defined in:
- lib/line_change/errors.rb
Overview
API errors
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(args) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(args) ⇒ APIError
Returns a new instance of APIError.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/line_change/errors.rb', line 8 def initialize(args) @status, @headers, @body = args[:status], args[:headers], parse_json(args[:body]) = body['message'] || (body['errors'] && (body['errors'])) || body super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/line_change/errors.rb', line 6 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/line_change/errors.rb', line 6 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/line_change/errors.rb', line 6 def status @status end |