Class: TTY::ProgressBar::TotalByteFormatter Private
- Inherits:
-
Object
- Object
- TTY::ProgressBar::TotalByteFormatter
- Defined in:
- lib/tty/progressbar/formatter/total_byte.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Used by Pipeline to format :total_byte token
Instance Method Summary collapse
-
#call(value) ⇒ Object
Format :total_byte token.
Instance Method Details
#call(value) ⇒ Object
Format :total_byte token
20 21 22 23 24 25 26 27 |
# File 'lib/tty/progressbar/formatter/total_byte.rb', line 20 def call(value) bytes = if @progress.indeterminate? "-B" else Converter.to_bytes(@progress.total) end value.gsub(matcher, bytes) end |