Files

ProgressBar::Components::Timer

Constants

TIME_FORMAT

Public Instance Methods

pause() click to toggle source
# File lib/ruby-progressbar/components/timer.rb, line 19
def pause
  stop
end
reset() click to toggle source
# File lib/ruby-progressbar/components/timer.rb, line 35
def reset
  @started_at = nil
  @stopped_at = nil
end
resume() click to toggle source
# File lib/ruby-progressbar/components/timer.rb, line 23
def resume
  start
end
start() click to toggle source
# File lib/ruby-progressbar/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/ruby-progressbar/components/timer.rb, line 27
def started?
  !!@started_at
end
stop() click to toggle source
# File lib/ruby-progressbar/components/timer.rb, line 13
def stop
  return unless started?

  @stopped_at = now
end
stopped?() click to toggle source
# File lib/ruby-progressbar/components/timer.rb, line 31
def stopped?
  !!@stopped_at
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.