class Fontist::Utils::ProgressBar

Public Class Methods

new(total) click to toggle source
# File lib/fontist/utils/downloader.rb, line 117
def initialize(total)
  @counter = 0
  @total  = total
  @printed_percent = -1
  @printed_size = -1
  @start = Time.now
end

Public Instance Methods

finish() click to toggle source
# File lib/fontist/utils/downloader.rb, line 135
def finish
  print

  Fontist.ui.print(format(", %<mb_per_second>.2f MiB/s, done.\n", mb_per_second: mb_per_second))
end
increment(progress) click to toggle source
# File lib/fontist/utils/downloader.rb, line 129
def increment(progress)
  @counter = progress

  print_incrementally
end
total=(total) click to toggle source
# File lib/fontist/utils/downloader.rb, line 125
def total=(total)
  @total = total
end