Class: Peek::Views::DelayedJob
- Inherits:
-
View
- Object
- View
- Peek::Views::DelayedJob
- Defined in:
- lib/peek/views/delayed_job.rb
Instance Method Summary collapse
- #context ⇒ Object
- #failure_count ⇒ Object
-
#initialize(options = {}) ⇒ DelayedJob
constructor
A new instance of DelayedJob.
- #label ⇒ Object
- #queued_count ⇒ Object
- #results ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ DelayedJob
Returns a new instance of DelayedJob.
4 5 6 |
# File 'lib/peek/views/delayed_job.rb', line 4 def initialize( = {}) @label = [:label] end |
Instance Method Details
#context ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/peek/views/delayed_job.rb', line 20 def context { jobs: { failed: self.failure_count } } end |
#failure_count ⇒ Object
16 17 18 |
# File 'lib/peek/views/delayed_job.rb', line 16 def failure_count Delayed::Job.where.not(failed_at: nil).count end |
#label ⇒ Object
8 9 10 |
# File 'lib/peek/views/delayed_job.rb', line 8 def label @label || 'delayed::job' end |
#queued_count ⇒ Object
12 13 14 |
# File 'lib/peek/views/delayed_job.rb', line 12 def queued_count Delayed::Job.count end |
#results ⇒ Object
28 29 30 31 32 33 |
# File 'lib/peek/views/delayed_job.rb', line 28 def results { queued: self.queued_count, failed: self.failure_count } end |