class TTY::ProgressBar::TotalByteFormatter

Used by {Pipeline} to format :total_byte token

@api private

Public Instance Methods

call(value) click to toggle source

Format :total_byte token

@param [String] value

the value to format

@api public

# 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