Class: AppnexusApi::Faraday::Response::ParseJson
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- AppnexusApi::Faraday::Response::ParseJson
- Defined in:
- lib/appnexusapi/faraday/parse_json.rb
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/appnexusapi/faraday/parse_json.rb', line 7 def call(env) @app.call(env).on_complete do if env[:response_headers]["content-type"].include?("application/json") env[:body] = convert_to_json(env[:body])["response"] check_for_error(env) end end end |