module BiteTheDust

Constants

VERSION

Public Class Methods

countdown(sec, &block) click to toggle source
# File lib/bite_the_dust.rb, line 10
def countdown(sec, &block)
  EM.run do
    EM.add_timer(sec) do
      EM.stop_event_loop        
      return block.call
    end
  end
end
future?(time) click to toggle source
# File lib/bite_the_dust.rb, line 6
def future?(time)
    Time.now < time
end

Private Instance Methods

countdown(sec, &block) click to toggle source
# File lib/bite_the_dust.rb, line 10
def countdown(sec, &block)
  EM.run do
    EM.add_timer(sec) do
      EM.stop_event_loop        
      return block.call
    end
  end
end
future?(time) click to toggle source
# File lib/bite_the_dust.rb, line 6
def future?(time)
    Time.now < time
end