Class: Squib::Progress Private
- Inherits:
-
Object
- Object
- Squib::Progress
- Defined in:
- lib/squib/progress.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A facade that handles (or doesn’t) the progress bar on the console
:nodoc:
Instance Attribute Summary collapse
- #enabled ⇒ Object private
Instance Method Summary collapse
-
#initialize(enabled) ⇒ Progress
constructor
private
A new instance of Progress.
- #start(title = '', total = 100, &block) ⇒ Object private
Constructor Details
#initialize(enabled) ⇒ Progress
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Progress.
22 23 24 |
# File 'lib/squib/progress.rb', line 22 def initialize(enabled) @enabled = enabled end |
Instance Attribute Details
#enabled ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/squib/progress.rb', line 20 def enabled @enabled end |
Instance Method Details
#start(title = '', total = 100, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 30 31 32 33 34 |
# File 'lib/squib/progress.rb', line 26 def start(title='', total=100, &block) if @enabled = ProgressBar.create(title: title, total: total, format: '%t <%B> %p%% %a') yield() .finish else yield(Squib::DoNothing.new) end end |