Class: Faraday::Response::MultiJson
- Inherits:
-
Response::Middleware
- Object
- Response::Middleware
- Faraday::Response::MultiJson
- Defined in:
- lib/faraday/response/multi_json.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ MultiJson
constructor
A new instance of MultiJson.
- #on_complete(env) ⇒ Object
Constructor Details
#initialize(*args) ⇒ MultiJson
Returns a new instance of MultiJson.
8 9 10 11 |
# File 'lib/faraday/response/multi_json.rb', line 8 def initialize(*args) super ::MultiJson.engine = :yajl end |
Instance Method Details
#on_complete(env) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/faraday/response/multi_json.rb', line 13 def on_complete(env) begin env[:body] = ::MultiJson.decode(env[:body]) rescue MultiJson::ParserError env[:body] = nil end end |