Class: MailHandler::Sender
- Inherits:
-
Object
- Object
- MailHandler::Sender
- Defined in:
- lib/mailhandler/sender.rb
Overview
Class for sending email, and storing details about the sending.
Direct Known Subclasses
Defined Under Namespace
Classes: Sending
Instance Attribute Summary collapse
-
#dispatcher ⇒ Object
Returns the value of attribute dispatcher.
-
#sending ⇒ Object
Returns the value of attribute sending.
-
#validate_response ⇒ Object
Returns the value of attribute validate_response.
Instance Method Summary collapse
- #dispatcher_client ⇒ Object
-
#initialize(dispatcher) ⇒ Sender
constructor
A new instance of Sender.
- #send_email(email) ⇒ Object
Constructor Details
Instance Attribute Details
#dispatcher ⇒ Object
Returns the value of attribute dispatcher.
11 12 13 |
# File 'lib/mailhandler/sender.rb', line 11 def dispatcher @dispatcher end |
#sending ⇒ Object
Returns the value of attribute sending.
11 12 13 |
# File 'lib/mailhandler/sender.rb', line 11 def sending @sending end |
#validate_response ⇒ Object
Returns the value of attribute validate_response.
11 12 13 |
# File 'lib/mailhandler/sender.rb', line 11 def validate_response @validate_response end |
Instance Method Details
#dispatcher_client ⇒ Object
37 38 39 |
# File 'lib/mailhandler/sender.rb', line 37 def dispatcher_client dispatcher.client if dispatcher.respond_to?(:client) end |
#send_email(email) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/mailhandler/sender.rb', line 29 def send_email(email) init_sending_details(email) response = dispatcher.send(email) update_sending_details(response) check_response(response) response end |