Sha256: 9ac917fd2d803633078988a3608c60b08ee6fa360e28c582b6f9e761a09c1540

Contents?: true

Size: 486 Bytes

Versions: 10

Compression:

Stored size: 486 Bytes

Contents

module Pacto
  class ResponseAdapter
    def initialize(response)
      @response = response
    end

    def status
      @response.code
    end

    def body
      @response.body
    end

    def headers
      # Normalize headers values according to RFC2616
      # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
      normalized_headers = @response.headers.map do |(key, value)|
        [key, value.join(',')]
      end
      Hash[normalized_headers]
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pacto-0.3.0.pre lib/pacto/response_adapter.rb
pacto-0.2.5 lib/pacto/response_adapter.rb
pacto-0.2.4 lib/pacto/response_adapter.rb
pacto-0.2.3 lib/pacto/response_adapter.rb
pacto-0.2.2 lib/pacto/response_adapter.rb
pacto-0.2.1 lib/pacto/response_adapter.rb
pacto-0.2.0 lib/pacto/response_adapter.rb
pacto-0.1.1 lib/pacto/response_adapter.rb
pacto-0.1.0 lib/pacto/response_adapter.rb
pacto-0.0.1 lib/pacto/response_adapter.rb