Class: Faraday::Response::Yajl

Inherits:
Middleware show all
Defined in:
lib/faraday/response/yajl.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) ⇒ Yajl

Returns a new instance of Yajl.



15
16
17
18
# File 'lib/faraday/response/yajl.rb', line 15

def initialize(app)
  super
  @parser = nil
end

Class Method Details

.parse(body) ⇒ Object



20
21
22
23
24
# File 'lib/faraday/response/yajl.rb', line 20

def self.parse(body)
  Yajl::Parser.parse(body)
rescue Object => err
  raise Faraday::Error::ParsingError.new(err)
end