class ImageOptim::Timer
Hold start time and timeout
Public Class Methods
new(seconds)
click to toggle source
# File lib/image_optim/timer.rb, line 10 def initialize(seconds) @start = now @seconds = seconds end
Public Instance Methods
elapsed()
click to toggle source
# File lib/image_optim/timer.rb, line 15 def elapsed now - @start end
left()
click to toggle source
# File lib/image_optim/timer.rb, line 19 def left @seconds - elapsed end
Also aliased as: to_f