Class: PonyExpress::Mail
- Inherits:
-
Object
- Object
- PonyExpress::Mail
- Includes:
- PonyExpress
- Defined in:
- lib/pony-express.rb
Constant Summary
Constants included from PonyExpress
DEFAULT_SMTP_OPTIONS, TRANSPORTS
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#add(options) ⇒ Object
Add an option.
-
#content ⇒ Object
Return the encoded email content.
- #deliver ⇒ Object
-
#dispatch ⇒ Object
Send the email via the selected transport.
-
#initialize(options = {}) ⇒ Mail
constructor
A new instance of Mail.
-
#remove(keys) ⇒ Object
Remove an option.
Methods included from PonyExpress
#build, #mail, #parse, #sendmail_binary, #sendmail_binary=, #transport_via_sendmail, transport_via_sendmail, #transport_via_smtp, transport_via_smtp
Constructor Details
#initialize(options = {}) ⇒ Mail
Returns a new instance of Mail.
106 107 108 |
# File 'lib/pony-express.rb', line 106 def initialize = {} @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
104 105 106 |
# File 'lib/pony-express.rb', line 104 def @options end |
Instance Method Details
#add(options) ⇒ Object
Add an option.
117 118 119 |
# File 'lib/pony-express.rb', line 117 def add @options.merge! end |
#content ⇒ Object
Return the encoded email content.
142 143 144 |
# File 'lib/pony-express.rb', line 142 def content build(@options) end |
#deliver ⇒ Object
138 |
# File 'lib/pony-express.rb', line 138 def deliver; dispatch end |
#dispatch ⇒ Object
Send the email via the selected transport.
135 136 137 |
# File 'lib/pony-express.rb', line 135 def dispatch mail(@options) end |
#remove(keys) ⇒ Object
Remove an option.
128 129 130 131 |
# File 'lib/pony-express.rb', line 128 def remove keys keys = keys.map(&:to_sym) @options.reject! {|k, v| keys.include?(k) } end |