Module: DMCourier::Configurable

Included in:
DMCourier, DeliveryMethod
Defined in:
lib/dm_courier/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def api_key
  @api_key
end

#asyncObject

Returns the value of attribute async.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def async
  @async
end

#auto_htmlObject

Returns the value of attribute auto_html.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def auto_html
  @auto_html
end

#auto_textObject

Returns the value of attribute auto_text.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def auto_text
  @auto_text
end

#bcc_addressObject

Returns the value of attribute bcc_address.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def bcc_address
  @bcc_address
end

#campaign_idObject

Returns the value of attribute campaign_id.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def campaign_id
  @campaign_id
end

#fromObject

Returns the value of attribute from.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def from
  @from
end

#importantObject

Returns the value of attribute important.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def important
  @important
end

#inline_cssObject

Returns the value of attribute inline_css.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def inline_css
  @inline_css
end

#ip_poolObject

Returns the value of attribute ip_pool.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def ip_pool
  @ip_pool
end

#log_contentObject

Returns the value of attribute log_content.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def log_content
  @log_content
end

#return_path_domainObject

Returns the value of attribute return_path_domain.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def return_path_domain
  @return_path_domain
end

#return_responseObject

Returns the value of attribute return_response.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def return_response
  @return_response
end

#service_nameObject

Returns the value of attribute service_name.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def service_name
  @service_name
end

#signing_domainObject

Returns the value of attribute signing_domain.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def signing_domain
  @signing_domain
end

#subaccountObject

Returns the value of attribute subaccount.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def subaccount
  @subaccount
end

#tagsObject

Returns the value of attribute tags.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def tags
  @tags
end

#track_clicksObject

Returns the value of attribute track_clicks.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def track_clicks
  @track_clicks
end

#track_opensObject

Returns the value of attribute track_opens.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def track_opens
  @track_opens
end

#track_url_without_query_stringObject

Returns the value of attribute track_url_without_query_string.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def track_url_without_query_string
  @track_url_without_query_string
end

#tracking_domainObject

Returns the value of attribute tracking_domain.



5
6
7
# File 'lib/dm_courier/configurable.rb', line 5

def tracking_domain
  @tracking_domain
end

Class Method Details

.keysObject



12
13
14
15
16
17
18
# File 'lib/dm_courier/configurable.rb', line 12

def keys
  @keys ||= [:api_key, :service_name, :async, :auto_html, :auto_text, :important,
             :inline_css, :track_clicks, :track_opens, :track_url_without_query_string,
             :log_content, :bcc_address, :return_path_domain, :signing_domain,
             :subaccount, :tracking_domain, :tags, :from, :return_response, :ip_pool,
             :campaign_id]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



21
22
23
# File 'lib/dm_courier/configurable.rb', line 21

def configure
  yield self
end

#optionsObject



38
39
40
41
# File 'lib/dm_courier/configurable.rb', line 38

def options
  Hash[DMCourier::Configurable
       .keys.map { |key| [key, instance_variable_get(:"@#{key}")] }]
end

#reset!Object Also known as: setup



25
26
27
28
29
30
31
# File 'lib/dm_courier/configurable.rb', line 25

def reset!
  DMCourier::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", DMCourier::Default.options[key])
  end

  self
end

#same_options?(opts) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/dm_courier/configurable.rb', line 34

def same_options?(opts)
  opts.hash == options.hash
end