class Caffeinate::Configuration
Global configuration
Attributes
If true, enqueues the processing of a ‘Caffeinate::Mailing` to the background worker class as defined in `async_delivery_class`
Default is false
The background worker class for ‘async_delivery`.
The number of ‘Caffeinate::Mailing` records we find in a batch at once.
The default reason for an ended ‘Caffeinate::CampaignSubscription`
The default reason for an unsubscribed ‘Caffeinate::CampaignSubscription`
If true, uses ‘deliver_later` instead of `deliver`
The path to the drippers
An array of Drippers that are enabled. Only used if you use Caffeinate.perform in your worker instead of calling separate drippers. If nil, will run all the campaigns.
Automatically creates a ‘Caffeinate::Campaign` record by the named slug of the campaign from a dripper if none is found by the slug.
Used for relation to a lot of things. If you have a weird time setup, set this. Accepts anything that responds to ‘#call`; you’ll probably use a block.
Public Class Methods
# File lib/caffeinate/configuration.rb, line 43 def initialize @now = -> { Time.current } @async_delivery = false @deliver_later = false @async_delivery_class = nil @batch_size = 1_000 @drippers_path = 'app/drippers' @implicit_campaigns = true @default_ended_reason = nil @default_unsubscribe_reason = nil @enabled_drippers = nil end
Public Instance Methods
# File lib/caffeinate/configuration.rb, line 70 def async_delivery? @async_delivery end
# File lib/caffeinate/configuration.rb, line 74 def deliver_later? @deliver_later end
# File lib/caffeinate/configuration.rb, line 62 def implicit_campaigns? @implicit_campaigns end
# File lib/caffeinate/configuration.rb, line 56 def now=(val) raise ArgumentError, '#now must be a proc' unless val.respond_to?(:call) @now = val end
# File lib/caffeinate/configuration.rb, line 66 def time_now @now.call end