Class: DirectoryWatcher::CoolioScanner::ScanTimer

Inherits:
Coolio::TimerWatcher
  • Object
show all
Defined in:
lib/directory_watcher/coolio_scanner.rb

Overview

Periodically execute a Scan. Hook this into the EventableScanner#on_scan

Instance Method Summary collapse

Constructor Details

#initialize(scanner) ⇒ ScanTimer

Returns a new instance of ScanTimer.



104
105
106
107
# File 'lib/directory_watcher/coolio_scanner.rb', line 104

def initialize( scanner )
  super(scanner.interval, true)
  @scanner = scanner
end

Instance Method Details

#on_timer(*args) ⇒ Object



109
110
111
# File 'lib/directory_watcher/coolio_scanner.rb', line 109

def on_timer( *args )
  @scanner.on_scan
end