Class: Caffeinate::PeriodicalDrip
- Defined in:
- lib/caffeinate/periodical_drip.rb
Overview
A PeriodicalDrip object
Handles the block and provides convenience methods for the drip
Constant Summary collapse
- VALID_DRIP_OPTIONS =
ALL_DRIP_OPTIONS + [:every, :until]
Constants inherited from Drip
Instance Attribute Summary
Attributes inherited from Drip
#action, #block, #dripper, #options
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Drip
build, #enabled?, #initialize, #parameterized?, #send_at, #type
Constructor Details
This class inherits a constructor from Caffeinate::Drip
Class Method Details
.assert_options(options) ⇒ Object
18 19 20 |
# File 'lib/caffeinate/periodical_drip.rb', line 18 def () .assert_valid_keys(*VALID_DRIP_OPTIONS) end |
.normalize_options(dripper, options) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/caffeinate/periodical_drip.rb', line 22 def (dripper, ) [:mailer_class] ||= [:mailer] || dripper.defaults[:mailer_class] [:using] ||= dripper.defaults[:using] [:step] ||= dripper.drips.size + 1 unless .key?(:every) raise "Periodical drips must have an `every` option." end end |
Instance Method Details
#every ⇒ Object
35 36 37 |
# File 'lib/caffeinate/periodical_drip.rb', line 35 def every [:every] end |