Class: CronTable::Definition
- Inherits:
-
Struct
- Object
- Struct
- CronTable::Definition
- Defined in:
- lib/cron-table/definition.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#every ⇒ Object
Returns the value of attribute every.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
2 3 4 |
# File 'lib/cron-table/definition.rb', line 2 def block @block end |
#every ⇒ Object
Returns the value of attribute every
2 3 4 |
# File 'lib/cron-table/definition.rb', line 2 def every @every end |
#key ⇒ Object
Returns the value of attribute key
2 3 4 |
# File 'lib/cron-table/definition.rb', line 2 def key @key end |
Instance Method Details
#next_run_at(context) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/cron-table/definition.rb', line 5 def next_run_at(context) case every when ActiveSupport::Duration (context.last_run_at || Time.current) + every when Symbol CronTable.every.fetch(every).call(context) end end |