Class: Algolia::Http::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/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

  • 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



13
14
15
16
17
18
19
20
# File 'lib/algolia/http/response.rb', line 13

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
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/algolia/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/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/http/response.rb', line 4

def headers
  @headers
end

#network_failureObject (readonly)

Returns the value of attribute network_failure.



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

def network_failure
  @network_failure
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end