Class: Yelp::Error::ResponseValidator
- Inherits:
-
Object
- Object
- Yelp::Error::ResponseValidator
- Defined in:
- lib/yelp/error.rb
Overview
Validates Yelp API responses. This class shouldn’t be used directly, but should be accessed through the Yelp::Error.check_for_error interface.
Instance Method Summary collapse
-
#validate(response) ⇒ Object
If the request is not successful, raise an appropriate Yelp::Error exception with the error text from the request response.
Instance Method Details
#validate(response) ⇒ Object
If the request is not successful, raise an appropriate Yelp::Error exception with the error text from the request response.
11 12 13 14 |
# File 'lib/yelp/error.rb', line 11 def validate(response) return if successful_response?(response) raise error_from_response(response) end |