Sha256: 74e6f50a3b436c52747afa173ead27731473e1eaab0cf1a3eb14999f0b2839d9

Contents?: true

Size: 431 Bytes

Versions: 12

Compression:

Stored size: 431 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] = Yajl::Parser.parse(finished_env[:body])
        end
      end
    rescue LoadError, NameError => e
      self.load_error = e
    end
    
    def initialize(app)
      super
      @parser = nil
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
faraday-0.4.6 lib/faraday/response/yajl.rb
faraday-0.4.5 lib/faraday/response/yajl.rb
faraday-0.4.4 lib/faraday/response/yajl.rb
faraday-0.4.3 lib/faraday/response/yajl.rb
faraday-0.4.2 lib/faraday/response/yajl.rb
faraday-0.4.1 lib/faraday/response/yajl.rb
faraday-0.4.0 lib/faraday/response/yajl.rb
faraday-0.3.1 lib/faraday/response/yajl.rb
faraday-0.3.0 lib/faraday/response/yajl.rb
faraday-0.2.4 lib/faraday/response/yajl.rb
faraday-0.2.3 lib/faraday/response/yajl.rb
faraday-0.2.2 lib/faraday/response/yajl.rb