Method: Flex::ProgBar#initialize
- Defined in:
- lib/flex/prog_bar.rb
#initialize(total_count, batch_size = nil, prefix_message = nil) ⇒ ProgBar
Returns a new instance of ProgBar.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/flex/prog_bar.rb', line 6 def initialize(total_count, batch_size=nil, =nil) @total_count = total_count @successful_count = 0 @failed_count = 0 @pbar = ::ProgressBar.new('processing...', total_count) @pbar.clear @pbar. = '|' puts '_' * @pbar.send(:get_term_width) = "#{}Processing #{total_count} documents" << " in batches of #{batch_size}:" unless batch_size.nil? puts @pbar.send(:show) end |