module ProgressBar::Components::Timer

Constants

TIME_FORMAT

Public Instance Methods

pause() click to toggle source
# File lib/progress_bar/components/timer.rb, line 17
def pause
  stop
end
reset() click to toggle source
# File lib/progress_bar/components/timer.rb, line 33
def reset
  @started_at = nil
  @stopped_at = nil
end
resume() click to toggle source
# File lib/progress_bar/components/timer.rb, line 21
def resume
  start
end
start() click to toggle source
# File lib/progress_bar/components/timer.rb, line 8
def start
  @started_at = stopped? ? now - (@stopped_at - @started_at) : now
  @stopped_at = nil
end
started?() click to toggle source
# File lib/progress_bar/components/timer.rb, line 25
def started?
  !!@started_at
end
stop() click to toggle source
# File lib/progress_bar/components/timer.rb, line 13
def stop
  @stopped_at = now
end
stopped?() click to toggle source
# File lib/progress_bar/components/timer.rb, line 29
def stopped?
  !!@stopped_at
end