class UnderOs::Timer::Duration

Attributes

seconds[R]

Public Class Methods

new(seconds) click to toggle source
# File lib/under_os/timer.rb, line 37
def initialize(seconds)
  @seconds = seconds.to_f
end

Public Instance Methods

==(duration) click to toggle source
# File lib/under_os/timer.rb, line 53
def ==(duration)
  duration.is_a?(UnderOs::Timer::Duration) && duration.seconds == @seconds
end
later(options={}, &block) click to toggle source
# File lib/under_os/timer.rb, line 57
def later(options={}, &block)
  UnderOs::Timer.in self, options={}, &block
end
repeat(options={}, &block) click to toggle source
# File lib/under_os/timer.rb, line 61
def repeat(options={}, &block)
  UnderOs::Timer.every self, options={}, &block
end
to_f() click to toggle source
# File lib/under_os/timer.rb, line 41
def to_f
  @seconds
end
to_i() click to toggle source
# File lib/under_os/timer.rb, line 45
def to_i
  to_f.to_i
end
to_s() click to toggle source
# File lib/under_os/timer.rb, line 49
def to_s
  "#{to_f} seconds"
end