Class: Puppet::Util::Watcher::PeriodicWatcher Private
- Defined in:
- lib/puppet/util/watcher/periodic_watcher.rb
Overview
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.
Monitor a given watcher for changes on a periodic interval.
Instance Method Summary collapse
-
#changed? ⇒ true, false
private
If the file has changed since it was last checked.
-
#initialize(watcher, timer) ⇒ PeriodicWatcher
constructor
private
A new instance of PeriodicWatcher.
Constructor Details
#initialize(watcher, timer) ⇒ PeriodicWatcher
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 PeriodicWatcher.
7 8 9 10 11 12 |
# File 'lib/puppet/util/watcher/periodic_watcher.rb', line 7 def initialize(watcher, timer) @watcher = watcher @timer = timer @timer.start end |
Instance Method Details
#changed? ⇒ true, false
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 If the file has changed since it was last checked.
15 16 17 18 19 20 |
# File 'lib/puppet/util/watcher/periodic_watcher.rb', line 15 def changed? return true if always_consider_changed? @watcher = examine_watched_info(@watcher) @watcher.changed? end |