Class: Faraday::Response::ActiveSupportJson

Inherits:
Middleware show all
Defined in:
lib/faraday/response/active_support_json.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Middleware

#call, register_on_complete

Methods inherited from Middleware

loaded?, setup_parallel_manager

Constructor Details

#initialize(app) ⇒ ActiveSupportJson



19
20
21
22
# File 'lib/faraday/response/active_support_json.rb', line 19

def initialize(app)
  super
  @parser = nil
end

Class Method Details

.parse(body) ⇒ Object



24
25
26
27
28
# File 'lib/faraday/response/active_support_json.rb', line 24

def self.parse(body)
  ActiveSupport::JSON.decode(body)
rescue Object => err
  raise Faraday::Error::ParsingError.new(err)
end