Class: DirectoryWatcher::Scan
- Inherits:
-
Object
- Object
- DirectoryWatcher::Scan
- Defined in:
- lib/directory_watcher/scan.rb
Overview
Instance Method Summary collapse
-
#initialize(globs = Array.new) ⇒ Scan
constructor
A new instance of Scan.
-
#results ⇒ Object
Return the results of the scan.
-
#run ⇒ Object
Run the entire scan and collect all the results.
Constructor Details
#initialize(globs = Array.new) ⇒ Scan
Returns a new instance of Scan.
8 9 10 11 |
# File 'lib/directory_watcher/scan.rb', line 8 def initialize( globs = Array.new ) @globs = [ globs ].flatten @results = Array.new end |
Instance Method Details
#results ⇒ Object
Return the results of the scan. If the scan has not been run yet, then run it
23 24 25 26 |
# File 'lib/directory_watcher/scan.rb', line 23 def results @results = collect_all_stats if @results.empty? return @results end |
#run ⇒ Object
Run the entire scan and collect all the results. The Scan will only ever be run once.
Return the array of FileStat results
17 18 19 |
# File 'lib/directory_watcher/scan.rb', line 17 def run results end |