Class: Uplink::UploadPartIterator
- Inherits:
-
Object
- Object
- Uplink::UploadPartIterator
- Defined in:
- lib/uplink/upload.rb
Instance Method Summary collapse
-
#initialize(upload_part_iterator) ⇒ UploadPartIterator
constructor
A new instance of UploadPartIterator.
- #item ⇒ Object
- #next? ⇒ Boolean
Constructor Details
#initialize(upload_part_iterator) ⇒ UploadPartIterator
Returns a new instance of UploadPartIterator.
183 184 185 |
# File 'lib/uplink/upload.rb', line 183 def initialize(upload_part_iterator) @upload_part_iterator = upload_part_iterator end |
Instance Method Details
#item ⇒ Object
201 202 203 204 205 206 |
# File 'lib/uplink/upload.rb', line 201 def item upload_part = UplinkLib.uplink_part_iterator_item(@upload_part_iterator) UploadPart.new(nil, upload_part) ensure UplinkLib.uplink_free_part(upload_part) if upload_part end |
#next? ⇒ Boolean
187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/uplink/upload.rb', line 187 def next? has_next = UplinkLib.uplink_part_iterator_next(@upload_part_iterator) unless has_next begin error = UplinkLib.uplink_part_iterator_err(@upload_part_iterator) ErrorUtil.handle_error(error) ensure UplinkLib.uplink_free_error(error) if error end end has_next end |