Class: MList::Server
- Inherits:
-
Object
- Object
- MList::Server
- Defined in:
- lib/mlist/server.rb
Instance Attribute Summary collapse
-
#email_server ⇒ Object
readonly
Returns the value of attribute email_server.
-
#list_manager ⇒ Object
readonly
Returns the value of attribute list_manager.
-
#notifier ⇒ Object
readonly
Returns the value of attribute notifier.
Instance Method Summary collapse
-
#initialize(config) ⇒ Server
constructor
A new instance of Server.
- #mail_list(list) ⇒ Object
- #receive_email(email) ⇒ Object
Constructor Details
Instance Attribute Details
#email_server ⇒ Object (readonly)
Returns the value of attribute email_server.
3 4 5 |
# File 'lib/mlist/server.rb', line 3 def email_server @email_server end |
#list_manager ⇒ Object (readonly)
Returns the value of attribute list_manager.
3 4 5 |
# File 'lib/mlist/server.rb', line 3 def list_manager @list_manager end |
#notifier ⇒ Object (readonly)
Returns the value of attribute notifier.
3 4 5 |
# File 'lib/mlist/server.rb', line 3 def notifier @notifier end |
Instance Method Details
#mail_list(list) ⇒ Object
23 24 25 |
# File 'lib/mlist/server.rb', line 23 def mail_list(list) MailList.find_or_create_by_list(list, @email_server) end |
#receive_email(email) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mlist/server.rb', line 12 def receive_email(email) lists = list_manager.lists(email) if lists.empty? list_manager.no_lists_found(email) elsif email.bounce? process_bounce(lists.first, email) else process_post(lists, email) end end |