Class: Theme::UI::SyncProgressBar
- Inherits:
-
Object
- Object
- Theme::UI::SyncProgressBar
- Defined in:
- lib/project_types/theme/ui/sync_progress_bar.rb
Instance Method Summary collapse
-
#initialize(syncer) ⇒ SyncProgressBar
constructor
A new instance of SyncProgressBar.
- #progress(method, **args) ⇒ Object
Constructor Details
#initialize(syncer) ⇒ SyncProgressBar
Returns a new instance of SyncProgressBar.
4 5 6 |
# File 'lib/project_types/theme/ui/sync_progress_bar.rb', line 4 def initialize(syncer) @syncer = syncer end |
Instance Method Details
#progress(method, **args) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/project_types/theme/ui/sync_progress_bar.rb', line 8 def progress(method, **args) @syncer.lock_io! CLI::UI::Progress.progress do || @syncer.public_send(method, **args) do |left, total| .tick(set_percent: 1 - left.to_f / total) end .tick(set_percent: 1) end @syncer.unlock_io! end |