Method: Aliyun::OSS::Iterator::Base#next

Defined in:
lib/aliyun/oss/iterator.rb

#nextObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/aliyun/oss/iterator.rb', line 20

def next
  loop do
    # Communicate with the server to get more results
    fetch_more if @results.empty?

    # Return the first result
    r = @results.shift
    break unless r

    yield r
  end
end