Class: Bonito::ProgressBar

Inherits:
Object
  • Object
show all
Includes:
ProgressCounter
Defined in:
lib/bonito/progress.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes included from ProgressCounter

#current, #total

Instance Method Summary collapse

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