Class: TTY::ProgressBar::Formatter

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/tty/progressbar/formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(pipeline = nil) ⇒ Formatter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Formatter.


26
27
28
# File 'lib/tty/progressbar/formatter.rb', line 26

def initialize(pipeline = nil)
  @pipeline = pipeline || TTY::ProgressBar::Pipeline.new
end

Instance Method Details

#loadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Prepare default pipeline formatters


33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/tty/progressbar/formatter.rb', line 33

def load
  @pipeline.use TTY::ProgressBar::CurrentFormatter
  @pipeline.use TTY::ProgressBar::TotalFormatter
  @pipeline.use TTY::ProgressBar::TotalByteFormatter
  @pipeline.use TTY::ProgressBar::ElapsedFormatter
  @pipeline.use TTY::ProgressBar::EstimatedFormatter
  @pipeline.use TTY::ProgressBar::PercentFormatter
  @pipeline.use TTY::ProgressBar::ByteFormatter
  @pipeline.use TTY::ProgressBar::ByteRateFormatter
  @pipeline.use TTY::ProgressBar::RateFormatter
  @pipeline.use TTY::ProgressBar::MeanRateFormatter
  @pipeline.use TTY::ProgressBar::MeanByteFormatter
  @pipeline.use TTY::ProgressBar::BarFormatter
end