Class: Algolia::Http::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/transport/http/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Response

Returns a new instance of Response.

Parameters:

  • status (Hash)

    a customizable set of options

  • reason_phrase (Hash)

    a customizable set of options

  • body (Hash)

    a customizable set of options

  • error (Hash)

    a customizable set of options

  • headers (Hash)

    a customizable set of options

  • has_timed_out (Hash)

    a customizable set of options



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/algolia/transport/http/response.rb', line 17

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/algolia/transport/http/response.rb', line 4

def body
  @body
end

#connect_timeoutObject (readonly)

used for the echo requester



7
8
9
# File 'lib/algolia/transport/http/response.rb', line 7

def connect_timeout
  @connect_timeout
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/algolia/transport/http/response.rb', line 4

def error
  @error
end

#has_timed_outObject (readonly)

Returns the value of attribute has_timed_out.



4
5
6
# File 'lib/algolia/transport/http/response.rb', line 4

def has_timed_out
  @has_timed_out
end

#headersObject (readonly)

Returns the value of attribute headers.



4
5
6
# File 'lib/algolia/transport/http/response.rb', line 4

def headers
  @headers
end

#hostObject (readonly)

used for the echo requester



7
8
9
# File 'lib/algolia/transport/http/response.rb', line 7

def host
  @host
end

#methodObject (readonly)

used for the echo requester



7
8
9
# File 'lib/algolia/transport/http/response.rb', line 7

def method
  @method
end

#network_failureObject (readonly)

Returns the value of attribute network_failure.



4
5
6
# File 'lib/algolia/transport/http/response.rb', line 4

def network_failure
  @network_failure
end

#pathObject (readonly)

used for the echo requester



7
8
9
# File 'lib/algolia/transport/http/response.rb', line 7

def path
  @path
end

#query_paramsObject (readonly)

used for the echo requester



7
8
9
# File 'lib/algolia/transport/http/response.rb', line 7

def query_params
  @query_params
end

#reason_phraseObject (readonly)

Returns the value of attribute reason_phrase.



4
5
6
# File 'lib/algolia/transport/http/response.rb', line 4

def reason_phrase
  @reason_phrase
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/algolia/transport/http/response.rb', line 4

def status
  @status
end

#timeoutObject (readonly)

used for the echo requester



7
8
9
# File 'lib/algolia/transport/http/response.rb', line 7

def timeout
  @timeout
end