Class: DMCourier::DeliveryMethod
- Inherits:
-
Object
- Object
- DMCourier::DeliveryMethod
- Includes:
- Configurable, ServiceLocator
- Defined in:
- lib/dm_courier/delivery_method.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Attributes included from Configurable
#api_key, #async, #auto_html, #auto_text, #bcc_address, #from, #important, #inline_css, #log_content, #return_path_domain, #service_name, #signing_domain, #subaccount, #tags, #track_clicks, #track_opens, #track_url_without_query_string, #tracking_domain
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(options = {}) ⇒ DeliveryMethod
constructor
A new instance of DeliveryMethod.
Methods included from Configurable
#configure, keys, #options, #reset!, #same_options?
Methods included from ServiceLocator
Constructor Details
#initialize(options = {}) ⇒ DeliveryMethod
Returns a new instance of DeliveryMethod.
10 11 12 13 14 15 |
# File 'lib/dm_courier/delivery_method.rb', line 10 def initialize( = {}) DMCourier::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", [key] || DMCourier.instance_variable_get(:"@#{key}")) end end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/dm_courier/delivery_method.rb', line 8 def response @response end |
Instance Method Details
#deliver!(mail) ⇒ Object
18 19 20 |
# File 'lib/dm_courier/delivery_method.rb', line 18 def deliver!(mail) @response = service.new(mail, ).deliver! end |