Class: MailHandler::Receiving::FolderChecker
- Includes:
- FileHandling
- Defined in:
- lib/mailhandler/receiving/folder.rb
Overview
folder checking base class
Constant Summary
Constants inherited from Checker
Checker::AVAILABLE_SEARCH_OPTIONS
Instance Attribute Summary collapse
-
#archive_folder ⇒ Object
folders in which emails will be searched for and managed.
-
#inbox_folder ⇒ Object
folders in which emails will be searched for and managed.
Attributes inherited from Checker
#available_search_options, #found_emails, #search_options
Instance Method Summary collapse
-
#find(options) ⇒ Object
check whether email is received by checking for an email in folder.
-
#initialize(inbox_folder = nil, archive_folder = nil) ⇒ FolderChecker
constructor
A new instance of FolderChecker.
- #start ⇒ Object
Methods included from FileHandling
Methods inherited from Checker
#reset_found_emails, #search_result, #stop
Constructor Details
#initialize(inbox_folder = nil, archive_folder = nil) ⇒ FolderChecker
Returns a new instance of FolderChecker.
18 19 20 21 22 23 |
# File 'lib/mailhandler/receiving/folder.rb', line 18 def initialize(inbox_folder = nil, archive_folder = nil) super() @inbox_folder = inbox_folder @archive_folder = archive_folder end |
Instance Attribute Details
#archive_folder ⇒ Object
folders in which emails will be searched for and managed
15 16 17 |
# File 'lib/mailhandler/receiving/folder.rb', line 15 def archive_folder @archive_folder end |
#inbox_folder ⇒ Object
folders in which emails will be searched for and managed
15 16 17 |
# File 'lib/mailhandler/receiving/folder.rb', line 15 def inbox_folder @inbox_folder end |
Instance Method Details
#find(options) ⇒ Object
check whether email is received by checking for an email in folder
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mailhandler/receiving/folder.rb', line 26 def find() () verify_mailbox_folders email_files = find_files() unless email_files.empty? @found_emails = parse_email_from_files(email_files, [:count]) move_files(email_files) if [:archive] end search_result end |
#start ⇒ Object
39 40 41 |
# File 'lib/mailhandler/receiving/folder.rb', line 39 def start verify_mailbox_folders end |