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.
20 21 22 23 24 25 |
# File 'lib/mailhandler/receiving/folder.rb', line 20 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
17 18 19 |
# File 'lib/mailhandler/receiving/folder.rb', line 17 def archive_folder @archive_folder end |
#inbox_folder ⇒ Object
folders in which emails will be searched for and managed
17 18 19 |
# File 'lib/mailhandler/receiving/folder.rb', line 17 def inbox_folder @inbox_folder end |
Instance Method Details
#find(options) ⇒ Object
check whether email is received by checking for an email in folder
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/mailhandler/receiving/folder.rb', line 28 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
41 42 43 |
# File 'lib/mailhandler/receiving/folder.rb', line 41 def start verify_mailbox_folders end |