Module: Caffeinate::Dripper::Defaults::ClassMethods

Defined in:
lib/caffeinate/dripper/defaults.rb

Instance Method Summary collapse

Instance Method Details

#default(options = {}) ⇒ Object

The default options for the Campaign

class OrderCampaign
  default mailer_class: "OrdersMailer"
end

Parameters:

  • options (Hash) (defaults to: {})

    The options to set defaults with

Options Hash (options):

  • :mailer_class (String)

    The mailer class



26
27
28
29
30
# File 'lib/caffeinate/dripper/defaults.rb', line 26

def default(options = {})
  options.symbolize_keys!
  options.assert_valid_keys(:mailer_class, :mailer, :using, :batch_size, :action_class)
  @defaults = options
end

#defaultsObject

The defaults set in the Campaign



14
15
16
# File 'lib/caffeinate/dripper/defaults.rb', line 14

def defaults
  @defaults ||= { mailer_class: inferred_mailer_class, batch_size: ::Caffeinate.config.batch_size }
end