class MailHandler::Receiving::FileList::Filter::Email

filtering file content by its email properties

Public Class Methods

new(files) click to toggle source
# File lib/mailhandler/receiving/filelist/filter/email.rb, line 12
def initialize(files)
  @fast_check = true
  super(files)
end

Protected Instance Methods

check_content_fast(_file) click to toggle source
# File lib/mailhandler/receiving/filelist/filter/email.rb, line 29
def check_content_fast(_file)
  raise MailHandler::InterfaceError, 'Interface not implemented.'
end
check_content_slow(_file) click to toggle source
# File lib/mailhandler/receiving/filelist/filter/email.rb, line 33
def check_content_slow(_file)
  raise MailHandler::InterfaceError, 'Interface not implemented.'
end
meets_expectation?(file) click to toggle source
# File lib/mailhandler/receiving/filelist/filter/email.rb, line 23
def meets_expectation?(file)
  # fast content checks search for content by file reading
  # slow content checks search for content by reconstructing email from file and then searching for content
  fast_check ? check_content_fast(file) : check_content_slow(file)
end
read_email_from_file(file) click to toggle source
# File lib/mailhandler/receiving/filelist/filter/email.rb, line 19
def read_email_from_file(file)
  Mail.read(file)
end