Sha256: 1c09dd44ec38960a03bd08a5ddd3093983b4910ffd83c53e26bb82ba22d52410

Contents?: true

Size: 359 Bytes

Versions: 4

Compression:

Stored size: 359 Bytes

Contents

require 'faraday_middleware/response_middleware'

module FaradayMiddleware
  # Public: Restore marshalled Ruby objects in response bodies.
  class ParseMarshal < ResponseMiddleware
    define_parser do |body|
      ::Marshal.load(body) unless body.empty?
    end
  end
end

# deprecated alias
Faraday::Response::ParseMarshal = FaradayMiddleware::ParseMarshal

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
faraday_middleware-0.14.0 lib/faraday_middleware/response/parse_marshal.rb
faraday_middleware-0.13.1 lib/faraday_middleware/response/parse_marshal.rb
faraday_middleware-0.13.0 lib/faraday_middleware/response/parse_marshal.rb
faraday_middleware-0.12.2 lib/faraday_middleware/response/parse_marshal.rb