Class: ConradFiler::DirPollingJob
- Inherits:
-
Object
- Object
- ConradFiler::DirPollingJob
- Defined in:
- lib/conrad_filer/dir_polling_job.rb
Class Method Summary collapse
- .all_jobs(db) ⇒ Object
-
.query ⇒ Object
Class Methods ##.
Instance Method Summary collapse
- #directory ⇒ Object
- #glob ⇒ Object
- #include_subdirs? ⇒ Boolean
-
#initialize(an_array) ⇒ DirPollingJob
constructor
Instance Methods ##.
- #perform ⇒ Object
Constructor Details
#initialize(an_array) ⇒ DirPollingJob
Instance Methods ##
26 27 28 |
# File 'lib/conrad_filer/dir_polling_job.rb', line 26 def initialize(an_array) @rec = an_array end |
Class Method Details
.all_jobs(db) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/conrad_filer/dir_polling_job.rb', line 15 def self.all_jobs(db) jobs = Array.new db.execute(self.query) do |row| jobs << self.new(row) end jobs end |
.query ⇒ Object
Class Methods ##
11 12 13 |
# File 'lib/conrad_filer/dir_polling_job.rb', line 11 def self.query "SELECT DIRECTORY, GLOB, INC_SUBDIR, POLLING_DELAY FROM POLLING_JOBS" end |
Instance Method Details
#directory ⇒ Object
34 35 36 |
# File 'lib/conrad_filer/dir_polling_job.rb', line 34 def directory @rec[1] end |
#glob ⇒ Object
38 39 40 |
# File 'lib/conrad_filer/dir_polling_job.rb', line 38 def glob @rec[2] end |
#include_subdirs? ⇒ Boolean
30 31 32 |
# File 'lib/conrad_filer/dir_polling_job.rb', line 30 def include_subdirs? @rec[3] == "T" end |
#perform ⇒ Object
42 43 44 |
# File 'lib/conrad_filer/dir_polling_job.rb', line 42 def perform # Loop over all entries in the directory and collect the files and subdirectories end |