You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: object_iterator.rb
    path of file: ./repos/algoliasearch-client-ruby/lib/algolia/iterators
    
    the code of the file until where you have to start completion: 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