Sha256: 3668455a10372b73bec4e3f5103b7701712bebd157a528cf4f3f050dda1bbab0
Contents?: true
Size: 729 Bytes
Versions: 19
Compression:
Stored size: 729 Bytes
Contents
module Algolia class ObjectIterator < BaseIterator # Custom each function to iterate through the objects # def each loop do data = {} if @response parsed_response = symbolize_hash(@response) if parsed_response[:hits].length parsed_response[:hits].each do |hit| yield hit end if parsed_response[:cursor].nil? @response = nil raise StopIteration else data[:cursor] = parsed_response[:cursor] end end end @response = @transporter.read(:POST, path_encode('1/indexes/%s/browse', @index_name), data, @opts) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems