Exception: TimeTree::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- TimeTree::ApiError
- Defined in:
- lib/timetree/api_error.rb
Overview
TimeTree apis client error object.
Instance Attribute Summary collapse
- #errors ⇒ String readonly
- #response ⇒ Faraday::Response readonly
- #status ⇒ Integer readonly
- #title ⇒ String readonly
- #type ⇒ String readonly
Instance Method Summary collapse
-
#initialize(response) ⇒ ApiError
constructor
A new instance of ApiError.
- #inspect ⇒ Object
Constructor Details
#initialize(response) ⇒ ApiError
Returns a new instance of ApiError.
17 18 19 20 21 22 23 |
# File 'lib/timetree/api_error.rb', line 17 def initialize(response) @response = response @type = response.body[:type] @title = response.body[:title] @errors = response.body[:errors] @status = response.status end |
Instance Attribute Details
#errors ⇒ String (readonly)
13 14 15 |
# File 'lib/timetree/api_error.rb', line 13 def errors @errors end |
#response ⇒ Faraday::Response (readonly)
7 8 9 |
# File 'lib/timetree/api_error.rb', line 7 def response @response end |
#status ⇒ Integer (readonly)
15 16 17 |
# File 'lib/timetree/api_error.rb', line 15 def status @status end |
#title ⇒ String (readonly)
11 12 13 |
# File 'lib/timetree/api_error.rb', line 11 def title @title end |
#type ⇒ String (readonly)
9 10 11 |
# File 'lib/timetree/api_error.rb', line 9 def type @type end |
Instance Method Details
#inspect ⇒ Object
25 26 27 |
# File 'lib/timetree/api_error.rb', line 25 def inspect "\#<#{self.class}:#{object_id} title:#{title}, status:#{status}>" end |