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.21.0.b185 lib/acfs/middleware/json_decoder.rb
acfs-0.20.0.dev.b184 lib/acfs/middleware/json_decoder.rb
acfs-0.21.0 lib/acfs/middleware/json_decoder.rb
acfs-0.20.0.dev.b183 lib/acfs/middleware/json_decoder.rb
acfs-0.20.0.dev.b182 lib/acfs/middleware/json_decoder.rb
acfs-0.20.0.dev.b181 lib/acfs/middleware/json_decoder.rb
acfs-0.20.0 lib/acfs/middleware/json_decoder.rb
acfs-0.19.0 lib/acfs/middleware/json_decoder.rb
acfs-0.18.0 lib/acfs/middleware/json_decoder.rb
acfs-0.17.0 lib/acfs/middleware/json_decoder.rb
acfs-0.16.0 lib/acfs/middleware/json_decoder.rb
acfs-0.15.0 lib/acfs/middleware/json_decoder.rb
acfs-0.14.0 lib/acfs/middleware/json_decoder.rb
acfs-0.13.0 lib/acfs/middleware/json_decoder.rb
acfs-0.12.0 lib/acfs/middleware/json_decoder.rb
acfs-0.11.0 lib/acfs/middleware/json_decoder.rb
acfs-0.10.0 lib/acfs/middleware/json_decoder.rb
acfs-0.9.0 lib/acfs/middleware/json_decoder.rb
acfs-0.8.0 lib/acfs/middleware/json_decoder.rb
acfs-0.7.0 lib/acfs/middleware/json_decoder.rb