Class: Algolia::IndexingResponse
- Inherits:
-
BaseResponse
- Object
- BaseResponse
- Algolia::IndexingResponse
- Defined in:
- lib/algolia/responses/indexing_response.rb
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
-
#initialize(index, response) ⇒ IndexingResponse
constructor
A new instance of IndexingResponse.
-
#wait(opts = {}) ⇒ Object
Wait for the task to complete.
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(index, response) ⇒ IndexingResponse
Returns a new instance of IndexingResponse.
8 9 10 11 12 |
# File 'lib/algolia/responses/indexing_response.rb', line 8 def initialize(index, response) @index = index @raw_response = response @done = false end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
3 4 5 |
# File 'lib/algolia/responses/indexing_response.rb', line 3 def raw_response @raw_response end |
Instance Method Details
#wait(opts = {}) ⇒ Object
Wait for the task to complete
18 19 20 21 22 23 24 25 26 |
# File 'lib/algolia/responses/indexing_response.rb', line 18 def wait(opts = {}) unless @done task_id = get_option(@raw_response, 'taskID') @index.wait_task(task_id, Defaults::WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, opts) end @done = true self end |