Sha256: b3f77530c35f7827de56e8d4f7403c154d2bfdcba668ca09c5e7060bbbfb3b0f

Contents?: true

Size: 1.22 KB

Versions: 6

Compression:

Stored size: 1.22 KB

Contents

module Algolia
  module Http
    class Response
      attr_reader :status, :reason_phrase, :body, :error, :headers, :has_timed_out, :network_failure

      # used for the echo requester
      attr_reader :method, :path, :query_params, :host, :timeout, :connect_timeout

      #
      # @option status    [String]  Response status
      # @option reason_phrase    [String]  Response reason phrase
      # @option body    [String]  Response body
      # @option error    [String]  Response error or caught error
      # @option headers    [String]  Response headers
      # @option has_timed_out    [String]  If the request has timed out
      #
      def initialize(opts = {})
        @status = opts[:status]
        @reason_phrase = opts[:reason_phrase]
        @body = opts[:body]
        @error = opts[:error] || ""
        @headers = opts[:headers] || ""
        @has_timed_out = opts[:has_timed_out] || false
        @network_failure = opts[:network_failure] || false

        @method = opts[:method] || ""
        @path = opts[:path] || ""
        @host = opts[:host] || ""
        @timeout = opts[:timeout] || 0
        @connect_timeout = opts[:connect_timeout] || 0
        @query_params = opts[:query_params] || {}
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
algolia-3.12.1 lib/algolia/transport/http/response.rb
algolia-3.12.0 lib/algolia/transport/http/response.rb
algolia-3.11.0 lib/algolia/transport/http/response.rb
algolia-3.10.2 lib/algolia/transport/http/response.rb
algolia-3.10.1 lib/algolia/transport/http/response.rb
algolia-3.8.2 lib/algolia/transport/http/response.rb