Sha256: c5db7dc4f58b24a5fae70b831aa8c6ab5c340250edf758adb55109db083daed0

Contents?: true

Size: 1.1 KB

Versions: 33

Compression:

Stored size: 1.1 KB

Contents

module Algolia
  module Http
    class Response
      attr_reader :status, :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 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]
        @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

33 entries across 33 versions & 1 rubygems

Version Path
algolia-3.8.1 lib/algolia/transport/http/response.rb
algolia-3.8.0 lib/algolia/transport/http/response.rb
algolia-3.7.1 lib/algolia/transport/http/response.rb
algolia-3.7.0 lib/algolia/transport/http/response.rb
algolia-3.6.0 lib/algolia/transport/http/response.rb
algolia-3.5.4 lib/algolia/transport/http/response.rb
algolia-3.5.3 lib/algolia/transport/http/response.rb
algolia-3.5.2 lib/algolia/transport/http/response.rb
algolia-3.5.1 lib/algolia/transport/http/response.rb
algolia-3.5.0 lib/algolia/transport/http/response.rb
algolia-3.4.0 lib/algolia/transport/http/response.rb
algolia-3.3.4 lib/algolia/transport/http/response.rb
algolia-3.3.3 lib/algolia/transport/http/response.rb
algolia-3.3.2 lib/algolia/transport/http/response.rb
algolia-3.3.1 lib/algolia/transport/http/response.rb
algolia-3.3.0 lib/algolia/transport/http/response.rb
algolia-3.2.4 lib/algolia/transport/http/response.rb
algolia-3.2.3 lib/algolia/transport/http/response.rb
algolia-3.2.2 lib/algolia/transport/http/response.rb
algolia-3.2.1 lib/algolia/transport/http/response.rb