Sha256: 9383789b2e678c8b8df97888d558768ca88ed38f650a418956630cc49394a147
Contents?: true
Size: 554 Bytes
Versions: 8
Compression:
Stored size: 554 Bytes
Contents
module Faraday class Response::Yajl < Response::Middleware begin require 'yajl' def self.register_on_complete(env) env[:response].on_complete do |finished_env| finished_env[:body] = parse(finished_env[:body]) end end rescue LoadError, NameError => e self.load_error = e end def initialize(app) super @parser = nil end def self.parse(body) Yajl::Parser.parse(body) rescue Object => err raise Faraday::Error::ParsingError.new(err) end end end
Version data entries
8 entries across 8 versions & 1 rubygems