Class: ConradFiler::DirPollingJob

Inherits:
Object
  • Object
show all
Defined in:
lib/conrad_filer/dir_polling_job.rb

Class Method Summary collapse

Instance Method Summary collapse

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

.queryObject

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

#directoryObject



34
35
36
# File 'lib/conrad_filer/dir_polling_job.rb', line 34

def directory  
  @rec[1]
end

#globObject



38
39
40
# File 'lib/conrad_filer/dir_polling_job.rb', line 38

def glob
  @rec[2]
end

#include_subdirs?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/conrad_filer/dir_polling_job.rb', line 30

def include_subdirs?
  @rec[3] == "T"
end

#performObject



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