Class: Aliyun::OSS::Iterator::Uploads

Inherits:
Base
  • Object
show all
Defined in:
lib/aliyun/oss/iterator.rb

Overview

Uploads iterator

Instance Method Summary collapse

Methods inherited from Base

#next, #to_enum

Constructor Details

#initialize(protocol, bucket_name, opts = {}) ⇒ Uploads

Returns a new instance of Uploads.



76
77
78
79
# File 'lib/aliyun/oss/iterator.rb', line 76

def initialize(protocol, bucket_name, opts = {})
  super(protocol, opts)
  @bucket = bucket_name
end

Instance Method Details

#fetch(more) ⇒ Object



81
82
83
84
85
86
87
# File 'lib/aliyun/oss/iterator.rb', line 81

def fetch(more)
  @results, cont = @protocol.list_multipart_uploads(@bucket, more)
  @results = cont[:common_prefixes] + @results if cont[:common_prefixes]
  @more[:id_marker] = cont[:next_id_marker]
  @more[:key_marker] = cont[:next_key_marker]
  @more[:truncated] = cont[:truncated] || false
end