Class: Caffeinate::Configuration
- Inherits:
-
Object
- Object
- Caffeinate::Configuration
- Defined in:
- lib/caffeinate/configuration.rb
Overview
Global configuration
Instance Attribute Summary collapse
-
#async_delivery ⇒ Object
Returns the value of attribute async_delivery.
-
#batch_size ⇒ Object
Returns the value of attribute batch_size.
-
#default_ended_reason ⇒ Object
Returns the value of attribute default_ended_reason.
-
#default_unsubscribe_reason ⇒ Object
Returns the value of attribute default_unsubscribe_reason.
-
#deliver_later ⇒ Object
Returns the value of attribute deliver_later.
-
#drippers_path ⇒ Object
Returns the value of attribute drippers_path.
-
#implicit_campaigns ⇒ Object
Returns the value of attribute implicit_campaigns.
-
#mailing_job ⇒ Object
Returns the value of attribute mailing_job.
-
#now ⇒ Object
Returns the value of attribute now.
Instance Method Summary collapse
-
#async_delivery? ⇒ Boolean
If delivery is asyncronous.
-
#deliver_later? ⇒ Boolean
If we should use
#deliver_laterinstead of#deliver. -
#implicit_campaigns? ⇒ Boolean
Automatically create a
::Caffeinate::Campaignobject if not found perDripper.inferred_campaign_slug. -
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#mailing_job_class ⇒ Object
The @mailing_job constantized.
-
#time_now ⇒ Object
The current time, for database calls.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/caffeinate/configuration.rb', line 9 def initialize @now = -> { Time.current } @async_delivery = false @deliver_later = false @mailing_job = nil @batch_size = 1_000 @drippers_path = 'app/drippers' @implicit_campaigns = true @default_ended_reason = nil @default_unsubscribe_reason = nil end |
Instance Attribute Details
#async_delivery ⇒ Object
Returns the value of attribute async_delivery.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def async_delivery @async_delivery end |
#batch_size ⇒ Object
Returns the value of attribute batch_size.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def batch_size @batch_size end |
#default_ended_reason ⇒ Object
Returns the value of attribute default_ended_reason.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def default_ended_reason @default_ended_reason end |
#default_unsubscribe_reason ⇒ Object
Returns the value of attribute default_unsubscribe_reason.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def default_unsubscribe_reason @default_unsubscribe_reason end |
#deliver_later ⇒ Object
Returns the value of attribute deliver_later.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def deliver_later @deliver_later end |
#drippers_path ⇒ Object
Returns the value of attribute drippers_path.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def drippers_path @drippers_path end |
#implicit_campaigns ⇒ Object
Returns the value of attribute implicit_campaigns.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def implicit_campaigns @implicit_campaigns end |
#mailing_job ⇒ Object
Returns the value of attribute mailing_job.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def mailing_job @mailing_job end |
#now ⇒ Object
Returns the value of attribute now.
6 7 8 |
# File 'lib/caffeinate/configuration.rb', line 6 def now @now end |
Instance Method Details
#async_delivery? ⇒ Boolean
If delivery is asyncronous
38 39 40 |
# File 'lib/caffeinate/configuration.rb', line 38 def async_delivery? @async_delivery end |
#deliver_later? ⇒ Boolean
If we should use #deliver_later instead of #deliver
43 44 45 |
# File 'lib/caffeinate/configuration.rb', line 43 def deliver_later? @deliver_later end |
#implicit_campaigns? ⇒ Boolean
Automatically create a ::Caffeinate::Campaign object if not found per Dripper.inferred_campaign_slug
28 29 30 |
# File 'lib/caffeinate/configuration.rb', line 28 def implicit_campaigns? @implicit_campaigns == true end |
#mailing_job_class ⇒ Object
The @mailing_job constantized. Only used if ‘async_delivery = true`
48 49 50 |
# File 'lib/caffeinate/configuration.rb', line 48 def mailing_job_class @mailing_job.constantize end |
#time_now ⇒ Object
The current time, for database calls
33 34 35 |
# File 'lib/caffeinate/configuration.rb', line 33 def time_now @now.call end |