Sha256: f883fdeadfe767ffdb1fc8f1f14edcb60069a25b4b8a3ed2e1680dee02ec453e

Contents?: true

Size: 312 Bytes

Versions: 121

Compression:

Stored size: 312 Bytes

Contents

require 'multi_json'

module Acfs
  module Middleware

    # A middleware to automatically decode JSON responses.
    #
    class JsonDecoder < Base

      def response(response, nxt)
        response.data = ::MultiJson.load(response.body) if response.json?
        nxt.call response
      end
    end
  end
end

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
acfs-0.40.1.rc1 lib/acfs/middleware/json_decoder.rb
acfs-0.40.0 lib/acfs/middleware/json_decoder.rb
acfs-0.39.1 lib/acfs/middleware/json_decoder.rb
acfs-0.39.0 lib/acfs/middleware/json_decoder.rb
acfs-1.0.0.dev.1.b305 lib/acfs/middleware/json_decoder.rb
acfs-0.38.0 lib/acfs/middleware/json_decoder.rb
acfs-1.0.0.dev.1.b298 lib/acfs/middleware/json_decoder.rb
acfs-1.0.0.dev.1.b297 lib/acfs/middleware/json_decoder.rb
acfs-0.37.0.1.b295 lib/acfs/middleware/json_decoder.rb
acfs-0.37.0 lib/acfs/middleware/json_decoder.rb
acfs-0.36.0.1.b293 lib/acfs/middleware/json_decoder.rb
acfs-0.36.0 lib/acfs/middleware/json_decoder.rb
acfs-0.35.0.1.b291 lib/acfs/middleware/json_decoder.rb
acfs-0.35.0 lib/acfs/middleware/json_decoder.rb
acfs-0.34.1.1.b289 lib/acfs/middleware/json_decoder.rb
acfs-0.34.1 lib/acfs/middleware/json_decoder.rb
acfs-0.34.0.1.b288 lib/acfs/middleware/json_decoder.rb
acfs-0.34.0.1.b287 lib/acfs/middleware/json_decoder.rb
acfs-0.34.0.1.b286 lib/acfs/middleware/json_decoder.rb
acfs-0.34.0 lib/acfs/middleware/json_decoder.rb