Class: WGif::DownloadBar
- Inherits:
-
Object
- Object
- WGif::DownloadBar
- Defined in:
- lib/wgif/download_bar.rb
Constant Summary collapse
- FORMAT =
'==> %p%% |%B|'- SMOOTHING =
0.8
Instance Attribute Summary collapse
-
#progress_bar ⇒ Object
readonly
Returns the value of attribute progress_bar.
Instance Method Summary collapse
- #increment_progress(size) ⇒ Object
-
#initialize ⇒ DownloadBar
constructor
A new instance of DownloadBar.
- #update_total(size) ⇒ Object
Constructor Details
#initialize ⇒ DownloadBar
Returns a new instance of DownloadBar.
11 12 13 14 15 16 17 |
# File 'lib/wgif/download_bar.rb', line 11 def initialize = ProgressBar.create( format: FORMAT, smoothing: SMOOTHING, total: @size ) end |
Instance Attribute Details
#progress_bar ⇒ Object (readonly)
Returns the value of attribute progress_bar.
9 10 11 |
# File 'lib/wgif/download_bar.rb', line 9 def end |
Instance Method Details
#increment_progress(size) ⇒ Object
23 24 25 |
# File 'lib/wgif/download_bar.rb', line 23 def increment_progress(size) .progress += size end |
#update_total(size) ⇒ Object
19 20 21 |
# File 'lib/wgif/download_bar.rb', line 19 def update_total(size) .total = size end |