Class: MailHandler::Receiving::IMAPChecker
- Defined in:
- lib/mailhandler/receiving/imap.rb
Constant Summary collapse
- AVAILABLE_SEARCH_OPTIONS =
[ :by_subject, :count, :archive ]
Instance Attribute Summary
Attributes inherited from Checker
#found_emails, #search_options
Instance Method Summary collapse
-
#details(address, port, username, password, use_ssl, authentication = nil) ⇒ Object
delegate retrieval details to Mail library.
- #find(options) ⇒ Object
-
#initialize ⇒ IMAPChecker
constructor
A new instance of IMAPChecker.
Methods inherited from Checker
#search_result, #verify_and_set_search_options
Constructor Details
#initialize ⇒ IMAPChecker
Returns a new instance of IMAPChecker.
19 20 21 22 23 |
# File 'lib/mailhandler/receiving/imap.rb', line 19 def initialize super end |
Instance Method Details
#details(address, port, username, password, use_ssl, authentication = nil) ⇒ Object
delegate retrieval details to Mail library
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/mailhandler/receiving/imap.rb', line 26 def details(address, port, username, password, use_ssl, authentication = nil) Mail.defaults do retriever_method :imap, :address => address, :port => port, :user_name => username, :password => password, :authentication => authentication, :enable_ssl => use_ssl end end |
#find(options) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/mailhandler/receiving/imap.rb', line 42 def find() () () emails = find_emails() unless emails.empty? emails.each do |email| @found_emails << email if email.subject.include? [:by_subject] end end search_result end |