Class: ZendeskAPI::Error::RecordInvalid
- Inherits:
-
ClientError
- Object
- Faraday::Error::ClientError
- ClientError
- ZendeskAPI::Error::RecordInvalid
- Defined in:
- lib/zendesk_api/error.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#response ⇒ Object
Returns the value of attribute response.
Attributes inherited from ClientError
Instance Method Summary collapse
-
#initialize(response) ⇒ RecordInvalid
constructor
A new instance of RecordInvalid.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ RecordInvalid
Returns a new instance of RecordInvalid.
10 11 12 13 14 15 16 17 18 |
# File 'lib/zendesk_api/error.rb', line 10 def initialize(response) @response = response if response[:body].is_a?(Hash) @errors = response[:body]["details"] || response[:body]["description"] end @errors ||= {} end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
8 9 10 |
# File 'lib/zendesk_api/error.rb', line 8 def errors @errors end |
#response ⇒ Object
Returns the value of attribute response.
8 9 10 |
# File 'lib/zendesk_api/error.rb', line 8 def response @response end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/zendesk_api/error.rb', line 20 def to_s "#{self.class.name}: #{@errors.to_s}" end |