Class: Timer::Timeout
Instance Attribute Summary
Attributes inherited from Abstruct
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(term, block) ⇒ Timeout
constructor
A new instance of Timeout.
Methods inherited from Abstruct
Constructor Details
#initialize(term, block) ⇒ Timeout
Returns a new instance of Timeout.
74 75 76 77 |
# File 'lib/skype/os/timer.rb', line 74 def initialize term, block @term = term + Time.now.to_i @block = block end |
Class Method Details
.polling(now) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/skype/os/timer.rb', line 61 def polling now @stack.delete_if do |timeout| if now >= timeout.term timeout.block.call true else false end end end |