Class: Cron::Tab
- Inherits:
-
Object
- Object
- Cron::Tab
- Includes:
- SearchAble, StandardModel
- Defined in:
- lib/app/jobs/cron/tab.rb
Direct Known Subclasses
Constant Summary collapse
- WILDCARD =
Constants
'*'- TIME_UNITS =
i[min hour wday mday month].freeze
Instance Method Summary collapse
-
#run ⇒ Object
For completion of class, but must be implemented by child class.
-
#time_to_run?(time) ⇒ Boolean
The method might look a bit obtuse, but basically we want to compare the time values for * Minute * Hour * Day of Week * Day of Month * Month.
Methods included from SearchAble
included, #search_fields, #sort_fields, #update_search_and_sort_text, #update_text
Methods included from StandardModel
#clear_cache, included, #remove_blank_secure_fields, #secure_fields, #update, #update!
Methods included from App47Logger
#clean_params, #delete_parameter_keys, #log_controller_error, #log_debug, log_debug, log_error, #log_error, log_exception, #log_message, log_message, #log_warn, log_warn, #mask_parameter_keys, #update_flash_messages
Instance Method Details
#run ⇒ Object
For completion of class, but must be implemented by child class
47 48 49 |
# File 'lib/app/jobs/cron/tab.rb', line 47 def run set last_run_at: Time.now.utc end |
#time_to_run?(time) ⇒ Boolean
The method might look a bit obtuse, but basically we want to compare the time values for
* Minute
* Hour
* Day of Week
* Day of Month
* Month
40 41 42 |
# File 'lib/app/jobs/cron/tab.rb', line 40 def time_to_run?(time) enabled? && TIME_UNITS.collect { |unit| valid_time?(time, unit, send(unit)) }.all? end |