Class: Vapir::TimeKeeper
- Inherits:
-
Object
- Object
- Vapir::TimeKeeper
- Defined in:
- lib/vapir-common/waiter.rb
Instance Attribute Summary collapse
-
#sleep_time ⇒ Object
readonly
Returns the value of attribute sleep_time.
Instance Method Summary collapse
-
#initialize ⇒ TimeKeeper
constructor
A new instance of TimeKeeper.
- #now ⇒ Object
- #sleep(seconds) ⇒ Object
Constructor Details
#initialize ⇒ TimeKeeper
Returns a new instance of TimeKeeper.
11 12 13 |
# File 'lib/vapir-common/waiter.rb', line 11 def initialize @sleep_time = 0.0 end |
Instance Attribute Details
#sleep_time ⇒ Object (readonly)
Returns the value of attribute sleep_time.
10 11 12 |
# File 'lib/vapir-common/waiter.rb', line 10 def sleep_time @sleep_time end |
Instance Method Details
#now ⇒ Object
17 18 19 |
# File 'lib/vapir-common/waiter.rb', line 17 def now Time.now end |
#sleep(seconds) ⇒ Object
14 15 16 |
# File 'lib/vapir-common/waiter.rb', line 14 def sleep seconds @sleep_time += Kernel.sleep seconds end |