File: response_parser.rb

package info (click to toggle)
ruby-excon 0.112.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: ruby: 7,855; makefile: 5
file content (16 lines) | stat: -rw-r--r-- 443 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true
module Excon
  module Middleware
    class ResponseParser < Excon::Middleware::Base
      def response_call(datum)
        unless datum.has_key?(:response)
          datum = Excon::Response.parse(datum[:connection].send(:socket), datum)
        end
        if datum.has_key?(:logger)
          datum[:response][:logger] = datum[:logger]
        end
        @stack.response_call(datum)
      end
    end
  end
end