google-apis-core/lib/google/apis/core/base_service.rb
def each
          page_token = nil
          item_count = 0
          loop do
            @last_result = @fetch_proc.call(page_token)
            items = @last_result.send(@items_field)
            if items.kind_of?(Array)
              for item in items
                item_count = item_count + 1
                break if @max && item_count > @max
                yield item
              end
            elsif items.kind_of?(Hash)
              items.each do |key, val|
                item_count = item_count + 1
                break if @max && item_count > @max
                yield key, val
              end
            elsif items
              # yield singular non-nil items (for genomics API)
              yield items
            end
            break if @max && item_count >= @max
            next_page_token = @last_result.send(@response_page_token_field)
            break if next_page_token.to_s.empty? || next_page_token == page_token
            page_token = next_page_token
          end
        end
# Iterates over result set, fetching additional pages as needed
Iterates over result set, fetching additional pages as needed
Iterates over result set fetching additional pages as needed
def each
          page_token = nil
          item_count = 0
          loop do
            @last_result = @fetch_proc.call(page_token)
            items = @last_result.send(@items_field)
            if items.kind_of?(Array)
              for item in items
                item_count = item_count + 1
                break if @max && item_count > @max
                yield item
              end
            elsif items.kind_of?(Hash)
              items.each do |key, val|
                item_count = item_count + 1
                break if @max && item_count > @max
                yield key, val
              end
            elsif items
              yield items
            end
            break if @max && item_count >= @max
            next_page_token = @last_result.send(@response_page_token_field)
            break if next_page_token.to_s.empty? || next_page_token == page_token
            page_token = next_page_token
          end
        end
def each page_token = nil item_count = 0 loop do @last_result = @fetch_proc . call ( page_token ) items = @last_result . send ( @items_field ) if items . kind_of? ( Array ) for item in items item_count = item_count + 1 break if @max && item_count > @max yield item end elsif items . kind_of? ( Hash ) items . each do | key , val | item_count = item_count + 1 break if @max && item_count > @max yield key , val end elsif items yield items end break if @max && item_count >= @max next_page_token = @last_result . send ( @response_page_token_field ) break if next_page_token . to_s . empty? || next_page_token == page_token page_token = next_page_token end end
Iterates over result set, fetching additional pages as needed
Iterates over result set fetching additional pages as needed
# yield singular non-nil items (for genomics API)