Class: Puppet::Util::Watcher::Timer Private
- Defined in:
- lib/puppet/util/watcher/timer.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #timeout ⇒ Object readonly private
Instance Method Summary collapse
- #expired? ⇒ Boolean private
-
#initialize(timeout) ⇒ Timer
constructor
private
A new instance of Timer.
- #now ⇒ Object private
- #start ⇒ Object private
Constructor Details
#initialize(timeout) ⇒ Timer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Timer.
4 5 6 |
# File 'lib/puppet/util/watcher/timer.rb', line 4 def initialize(timeout) @timeout = timeout end |
Instance Attribute Details
#timeout ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2 3 4 |
# File 'lib/puppet/util/watcher/timer.rb', line 2 def timeout @timeout end |
Instance Method Details
#expired? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/puppet/util/watcher/timer.rb', line 12 def expired? (now - @start_time) >= @timeout end |
#now ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/puppet/util/watcher/timer.rb', line 16 def now Time.now.to_i end |
#start ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/puppet/util/watcher/timer.rb', line 8 def start @start_time = now end |