Class: ProgressBar::Components::ElapsedTimer

Inherits:
Object
  • Object
show all
Includes:
Timer
Defined in:
lib/ruby-progressbar/components/elapsed_timer.rb

Constant Summary

Constants included from Timer

Timer::TIME_FORMAT

Instance Method Summary collapse

Methods included from Timer

#pause, #reset, #resume, #start, #started?, #stop, #stopped?

Constructor Details

#initializeElapsedTimer

Returns a new instance of ElapsedTimer.



6
7
8
9
# File 'lib/ruby-progressbar/components/elapsed_timer.rb', line 6

def initialize
  @started_at = nil
  @stopped_at = nil
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/ruby-progressbar/components/elapsed_timer.rb', line 11

def to_s
  "Time: #{elapsed_time}"
end