Class: TTY::ProgressBar::ByteFormatter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/tty/progressbar/formatter/current_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 :byte and :current_byte tokens

Instance Method Summary collapse

Instance Method Details

#call(value) ⇒ Object

Format :current_byte token

Parameters:

  • value (String)

    the value to format



20
21
22
23
# File 'lib/tty/progressbar/formatter/current_byte.rb', line 20

def call(value)
  bytes = Converter.to_bytes(@progress.current)
  value.gsub(matcher, bytes)
end