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

#create_form_params, #full_path_for, loaded?, #process_body_for_request, 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 Yajl::ParseError => e
  raise Faraday::Error::ParsingError
end