Class: Translatomatic::ProgressUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/translatomatic/progress_updater.rb

Overview

Class to update the progress bar for the CLI

Instance Method Summary collapse

Constructor Details

#initialize(progressbar) ⇒ ProgressUpdater

Create a new progress updater

Parameters:

  • progressbar (Progressbar)

    A ruby-progressbar object



6
7
8
# File 'lib/translatomatic/progress_updater.rb', line 6

def initialize(progressbar)
  @progressbar = progressbar
end

Instance Method Details

#update_progress(count) ⇒ Number

Returns The total number of processed items.

Parameters:

  • count (Number)

    Update progress

Returns:

  • (Number)

    The total number of processed items.



12
13
14
# File 'lib/translatomatic/progress_updater.rb', line 12

def update_progress(count)
  @progressbar.progress += count
end