class EmailFetchAndProcess::Job
Class tp encapsulate a fetch and handle job.
Public Class Methods
new(args = {})
click to toggle source
# File lib/email-fetch-and-process.rb, line 16 def initialize(args = {}) @args = default_args.merge args end
Public Instance Methods
action()
click to toggle source
# File lib/email-fetch-and-process.rb, line 42 def action @args[:action] end
default_args()
click to toggle source
# File lib/email-fetch-and-process.rb, line 20 def default_args { fetch: ['SUBJECT', ''], filename: '', action: 'echo FILEPATH', subdirectory: nil, destination: '/tmp' } end
destination()
click to toggle source
# File lib/email-fetch-and-process.rb, line 50 def destination @args[:destination] end
fetch()
click to toggle source
# File lib/email-fetch-and-process.rb, line 30 def fetch @args[:fetch] end
filename()
click to toggle source
# File lib/email-fetch-and-process.rb, line 38 def filename @args[:filename] end
multiple_fetch_terms?()
click to toggle source
# File lib/email-fetch-and-process.rb, line 34 def multiple_fetch_terms? @args[:fetch][0].is_a?(Array) end
subdirectory()
click to toggle source
# File lib/email-fetch-and-process.rb, line 46 def subdirectory @args[:subdirectory] end