Class: Liri::Common::TtyProgressbar::TimeFormatter
- Inherits:
-
Object
- Object
- Liri::Common::TtyProgressbar::TimeFormatter
- Defined in:
- lib/common/tty_progressbar.rb
Overview
From
Instance Method Summary collapse
-
#call(value) ⇒ Object
specify how display string is formatted.
Instance Method Details
#call(value) ⇒ Object
specify how display string is formatted
62 63 64 65 66 |
# File 'lib/common/tty_progressbar.rb', line 62 def call(value) # specify how display string is formatted # access current progress bar instance to read start time elapsed = Duration.humanize(Time.now - progress.start_time, times_round: Liri.times_round, times_round_type: Liri.times_round_type) value.gsub(matcher, elapsed) # replace :time token with a value end |