Class: MailRoom::MailboxHandler
- Inherits:
-
Object
- Object
- MailRoom::MailboxHandler
- Defined in:
- lib/mail_room/mailbox_handler.rb
Overview
Fetches new email messages for delivery
Instance Method Summary collapse
-
#initialize(mailbox, imap) ⇒ MailboxHandler
constructor
build a handler for this mailbox and our imap connection.
-
#process ⇒ Object
deliver each of the new messages.
Constructor Details
#initialize(mailbox, imap) ⇒ MailboxHandler
build a handler for this mailbox and our imap connection
8 9 10 11 |
# File 'lib/mail_room/mailbox_handler.rb', line 8 def initialize(mailbox, imap) @mailbox = mailbox @imap = imap end |
Instance Method Details
#process ⇒ Object
deliver each of the new messages
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mail_room/mailbox_handler.rb', line 14 def process # return if idling? || !running? .each do |msg| # puts msg.attr['RFC822'] # loop over delivery methods and deliver each @mailbox.deliver(msg) end end |