Class: DirectoryWatcher::ScanAndQueue
- Inherits:
-
Object
- Object
- DirectoryWatcher::ScanAndQueue
- Defined in:
- lib/directory_watcher/scan_and_queue.rb
Overview
ScanAndQueue creates a Scan from its input globs and then sends that Scan to its Queue.
Every time scan_and_queue is called a new scan is created an sent to the queue.
Instance Method Summary collapse
-
#initialize(glob, queue) ⇒ ScanAndQueue
constructor
A new instance of ScanAndQueue.
-
#scan_and_queue ⇒ Object
Create and run a Scan and submit it to the Queue.
Constructor Details
#initialize(glob, queue) ⇒ ScanAndQueue
Returns a new instance of ScanAndQueue.
8 9 10 11 |
# File 'lib/directory_watcher/scan_and_queue.rb', line 8 def initialize( glob, queue ) @globs = glob @queue =queue end |
Instance Method Details
#scan_and_queue ⇒ Object
Create and run a Scan and submit it to the Queue.
Returns the Scan that was run
16 17 18 19 20 21 |
# File 'lib/directory_watcher/scan_and_queue.rb', line 16 def scan_and_queue scan = ::DirectoryWatcher::Scan.new( @globs ) scan.run @queue.enq scan return scan end |