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.
-
#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.
-
#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.
8 9 10 11 12 13 14 15 |
# File 'lib/caffeinate/configuration.rb', line 8 def initialize @now = -> { Time.current } @async_delivery = false @mailing_job = nil @batch_size = 1_000 @drippers_path = 'app/drippers' @implicit_campaigns = true 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 |
#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
34 35 36 |
# File 'lib/caffeinate/configuration.rb', line 34 def async_delivery? @async_delivery end |
#implicit_campaigns? ⇒ Boolean
Automatically create a ::Caffeinate::Campaign object if not found per Dripper.inferred_campaign_slug
24 25 26 |
# File 'lib/caffeinate/configuration.rb', line 24 def implicit_campaigns? @implicit_campaigns == true end |
#mailing_job_class ⇒ Object
The @mailing_job constantized. Only used if ‘async_delivery = true`
39 40 41 |
# File 'lib/caffeinate/configuration.rb', line 39 def mailing_job_class @mailing_job.constantize end |
#time_now ⇒ Object
The current time, for database calls
29 30 31 |
# File 'lib/caffeinate/configuration.rb', line 29 def time_now @now.call end |