Class: BN::Middleware::APIResponse
- Defined in:
- lib/bn/middleware/api_error.rb
Overview
Checks the JSON API response to see if it is an error.
Instance Method Summary collapse
-
#execute(data) ⇒ Hash
Execute the middleware.
Methods inherited from Base
Constructor Details
This class inherits a constructor from BN::Middleware::Base
Instance Method Details
#execute(data) ⇒ Hash
Execute the middleware.
12 13 14 15 16 17 18 |
# File 'lib/bn/middleware/api_error.rb', line 12 def execute(data) data = data.to_h raise BN::Error::Middleware::InvalidAPIRequest, data if error?(data) data end |