Class: MailHandler::Receiving::IMAPChecker
- Defined in:
- lib/mailhandler/receiving/imap.rb
Overview
in charge of retrieving email by IMAP
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#authentication ⇒ Object
Returns the value of attribute authentication.
-
#manual_connection_manage ⇒ Object
Connection is closed by default after each search.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes inherited from Checker
#available_search_options, #found_emails, #search_options
Instance Method Summary collapse
- #connect ⇒ Object
- #disconnect ⇒ Object
- #find(options) ⇒ Object
-
#init_retriever ⇒ Object
delegate retrieval details to Mail library set imap settings if they are not set.
-
#initialize ⇒ IMAPChecker
constructor
A new instance of IMAPChecker.
- #start ⇒ Object
- #stop ⇒ Object
Methods inherited from Checker
#reset_found_emails, #search_result
Constructor Details
#initialize ⇒ IMAPChecker
Returns a new instance of IMAPChecker.
22 23 24 25 26 |
# File 'lib/mailhandler/receiving/imap.rb', line 22 def initialize super @manual_connection_manage = false @available_search_options = AVAILABLE_SEARCH_OPTIONS end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
11 12 13 |
# File 'lib/mailhandler/receiving/imap.rb', line 11 def address @address end |
#authentication ⇒ Object
Returns the value of attribute authentication.
11 12 13 |
# File 'lib/mailhandler/receiving/imap.rb', line 11 def authentication @authentication end |
#manual_connection_manage ⇒ Object
Connection is closed by default after each search. By setting this flag, closing connection is ignored and you need to close it manually.
20 21 22 |
# File 'lib/mailhandler/receiving/imap.rb', line 20 def manual_connection_manage @manual_connection_manage end |
#password ⇒ Object
Returns the value of attribute password.
11 12 13 |
# File 'lib/mailhandler/receiving/imap.rb', line 11 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
11 12 13 |
# File 'lib/mailhandler/receiving/imap.rb', line 11 def port @port end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
11 12 13 |
# File 'lib/mailhandler/receiving/imap.rb', line 11 def use_ssl @use_ssl end |
#username ⇒ Object
Returns the value of attribute username.
11 12 13 |
# File 'lib/mailhandler/receiving/imap.rb', line 11 def username @username end |
Instance Method Details
#connect ⇒ Object
48 49 50 |
# File 'lib/mailhandler/receiving/imap.rb', line 48 def connect mailer.connect end |
#disconnect ⇒ Object
52 53 54 55 56 |
# File 'lib/mailhandler/receiving/imap.rb', line 52 def disconnect return if mailer.imap_connection.disconnected? mailer.disconnect end |
#find(options) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/mailhandler/receiving/imap.rb', line 28 def find() () @found_emails = find_emails() search_result end |
#init_retriever ⇒ Object
delegate retrieval details to Mail library set imap settings if they are not set
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mailhandler/receiving/imap.rb', line 60 def init_retriever return if retriever_set? imap_settings = retriever_settings Mail.defaults do retriever_method :imap, imap_settings end end |
#start ⇒ Object
35 36 37 38 39 40 |
# File 'lib/mailhandler/receiving/imap.rb', line 35 def start return if manual_connection_manage init_retriever connect end |
#stop ⇒ Object
42 43 44 45 46 |
# File 'lib/mailhandler/receiving/imap.rb', line 42 def stop return if manual_connection_manage disconnect end |