Class: Bonito::ProgressBar
- Inherits:
-
Object
- Object
- Bonito::ProgressBar
- Includes:
- ProgressCounter
- Defined in:
- lib/bonito/progress.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes included from ProgressCounter
Instance Method Summary collapse
-
#initialize(**opts) ⇒ ProgressBar
constructor
A new instance of ProgressBar.
- #on_increment(increment) ⇒ Object
Methods included from ProgressCounter
included, #increment, #setup, #to_s
Constructor Details
#initialize(**opts) ⇒ ProgressBar
Returns a new instance of ProgressBar.
67 68 69 70 71 |
# File 'lib/bonito/progress.rb', line 67 def initialize(**opts) @bar = ::ProgressBar.create opts @bar.total = opts[:total] setup opts end |
Instance Method Details
#on_increment(increment) ⇒ Object
73 74 75 |
# File 'lib/bonito/progress.rb', line 73 def on_increment(increment) increment.times { @bar.increment } end |