Class: Flightdeck::RecurringCatalog::Row
- Inherits:
-
Struct
- Object
- Struct
- Flightdeck::RecurringCatalog::Row
- Defined in:
- app/models/flightdeck/recurring_catalog.rb
Instance Attribute Summary collapse
-
#last_job_id ⇒ Object
Returns the value of attribute last_job_id.
-
#last_run_at ⇒ Object
Returns the value of attribute last_run_at.
-
#last_status ⇒ Object
Returns the value of attribute last_status.
-
#task ⇒ Object
Returns the value of attribute task.
Instance Method Summary collapse
- #description ⇒ Object
- #ever_run? ⇒ Boolean
- #failed? ⇒ Boolean
- #human_schedule ⇒ Object
- #id ⇒ Object
- #job_class ⇒ Object
- #key ⇒ Object
-
#next_run_at ⇒ Object
Fugit raises on schedules it cannot parse.
- #next_run_in ⇒ Object
- #priority ⇒ Object
- #queue_name ⇒ Object
- #schedule ⇒ Object
- #static? ⇒ Boolean
Instance Attribute Details
#last_job_id ⇒ Object
Returns the value of attribute last_job_id
11 12 13 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 11 def last_job_id @last_job_id end |
#last_run_at ⇒ Object
Returns the value of attribute last_run_at
11 12 13 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 11 def last_run_at @last_run_at end |
#last_status ⇒ Object
Returns the value of attribute last_status
11 12 13 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 11 def last_status @last_status end |
#task ⇒ Object
Returns the value of attribute task
11 12 13 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 11 def task @task end |
Instance Method Details
#description ⇒ Object
17 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 17 def description = task.description |
#ever_run? ⇒ Boolean
41 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 41 def ever_run? = last_run_at.present? |
#failed? ⇒ Boolean
40 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 40 def failed? = last_status == :failed |
#human_schedule ⇒ Object
24 25 26 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 24 def human_schedule CronSchedule.humanize(schedule) end |
#id ⇒ Object
12 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 12 def id = task.id |
#job_class ⇒ Object
20 21 22 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 20 def job_class task.class_name.presence || task.command.presence || "(command)" end |
#key ⇒ Object
13 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 13 def key = task.key |
#next_run_at ⇒ Object
Fugit raises on schedules it cannot parse. A task that is on screen but unparseable should show "—" rather than take the page down.
30 31 32 33 34 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 30 def next_run_at @next_run_at ||= task.next_time rescue StandardError nil end |
#next_run_in ⇒ Object
36 37 38 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 36 def next_run_in next_run_at && next_run_at - Time.current end |
#priority ⇒ Object
16 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 16 def priority = task.priority |
#queue_name ⇒ Object
15 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 15 def queue_name = task.queue_name |
#schedule ⇒ Object
14 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 14 def schedule = task.schedule |
#static? ⇒ Boolean
18 |
# File 'app/models/flightdeck/recurring_catalog.rb', line 18 def static? = task.static? |