Class: Qiniu::RS::UP::ChunkProgressNotifier
- Inherits:
-
AbstractClass::ChunkProgressNotifier
- Object
- AbstractClass::ChunkProgressNotifier
- Qiniu::RS::UP::ChunkProgressNotifier
- Defined in:
- lib/qiniu/rs/up.rb
Instance Attribute Summary collapse
-
#tmpdata ⇒ Object
readonly
Returns the value of attribute tmpdata.
Instance Method Summary collapse
-
#initialize(id) ⇒ ChunkProgressNotifier
constructor
A new instance of ChunkProgressNotifier.
- #notify(index, progress) ⇒ Object
Constructor Details
#initialize(id) ⇒ ChunkProgressNotifier
36 37 38 |
# File 'lib/qiniu/rs/up.rb', line 36 def initialize(id) @tmpdata = UP::TmpData.new(id, PROGRESS_TMP_FILE) end |
Instance Attribute Details
#tmpdata ⇒ Object (readonly)
Returns the value of attribute tmpdata.
35 36 37 |
# File 'lib/qiniu/rs/up.rb', line 35 def tmpdata @tmpdata end |
Instance Method Details
#notify(index, progress) ⇒ Object
39 40 41 42 43 |
# File 'lib/qiniu/rs/up.rb', line 39 def notify(index, progress) @tmpdata.set(index, progress) logmsg = "chunk #{progress[:offset]/Config.settings[:chunk_size]} in block #{index} successfully uploaded.\n" + progress.to_s Utils.debug(logmsg) end |