Parent

Wait::BaseDelayer

Attributes

logger[RW]

Public Class Methods

new(delay) click to toggle source
# File lib/delayers/base.rb, line 5
def initialize(delay)
  @delay = delay
end

Public Instance Methods

log() click to toggle source

Logs how long the delay is.

# File lib/delayers/base.rb, line 16
def log
  return if @logger.nil?

  @logger.debug("Delayer") { "delaying for #{self}" }
end
sleep() click to toggle source

Called before a reattempt to sleep a certain about of time.

# File lib/delayers/base.rb, line 10
def sleep
  log
  Kernel.sleep(@delay)
end
to_s() click to toggle source

Returns a string representation of the delay.

# File lib/delayers/base.rb, line 23
def to_s
  "#{@delay}s"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.