Class: Algolia::MultipleIndexBatchIndexingResponse

Inherits:
BaseResponse
  • Object
show all
Defined in:
lib/algolia/responses/multiple_batch_indexing_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#check_array, #check_object, #chunk, #deserialize_settings, #get_object_id, #get_option, #handle_params, #hash_includes_subset?, included, #json_to_hash, #path_encode, #symbolize_hash, #to_json, #to_query_string

Constructor Details

#initialize(client, response) ⇒ MultipleIndexBatchIndexingResponse

Returns a new instance of MultipleIndexBatchIndexingResponse.

Parameters:

  • client (Search::Client)

    Algolia Search Client used for verification

  • response (Hash)

    Raw response from the client



8
9
10
11
12
# File 'lib/algolia/responses/multiple_batch_indexing_response.rb', line 8

def initialize(client, response)
  @client       = client
  @raw_response = response
  @done         = false
end

Instance Attribute Details

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



3
4
5
# File 'lib/algolia/responses/multiple_batch_indexing_response.rb', line 3

def raw_response
  @raw_response
end

Instance Method Details

#wait(opts = {}) ⇒ Object

Wait for the task to complete

Parameters:

  • opts (Hash) (defaults to: {})

    contains extra parameters to send with your query



18
19
20
21
22
23
24
25
26
27
# File 'lib/algolia/responses/multiple_batch_indexing_response.rb', line 18

def wait(opts = {})
  unless @done
    @raw_response[:taskID].each do |index_name, task_id|
      @client.wait_task(index_name, task_id, Defaults::WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, opts)
    end
  end

  @done = true
  self
end