Class: Que::Web::Viewmodels::Job
- Inherits:
-
Struct
- Object
- Struct
- Que::Web::Viewmodels::Job
- Defined in:
- lib/que/web/viewmodels/job.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#backend_pid ⇒ Object
Returns the value of attribute backend_pid.
-
#data ⇒ Object
Returns the value of attribute data.
-
#error_count ⇒ Object
Returns the value of attribute error_count.
-
#expired_at ⇒ Object
Returns the value of attribute expired_at.
-
#finished_at ⇒ Object
Returns the value of attribute finished_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#job_class ⇒ Object
Returns the value of attribute job_class.
-
#last_error_backtrace ⇒ Object
Returns the value of attribute last_error_backtrace.
-
#last_error_message ⇒ Object
Returns the value of attribute last_error_message.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#run_at ⇒ Object
Returns the value of attribute run_at.
Instance Method Summary collapse
- #humanized_job_class ⇒ Object
-
#initialize(job) ⇒ Job
constructor
A new instance of Job.
- #past_due?(relative_to = Time.now) ⇒ Boolean
Constructor Details
#initialize(job) ⇒ Job
Returns a new instance of Job.
7 8 9 10 11 |
# File 'lib/que/web/viewmodels/job.rb', line 7 def initialize(job) members.each do |m| self[m] = job[m] end end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def args @args end |
#backend_pid ⇒ Object
Returns the value of attribute backend_pid
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def backend_pid @backend_pid end |
#data ⇒ Object
Returns the value of attribute data
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def data @data end |
#error_count ⇒ Object
Returns the value of attribute error_count
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def error_count @error_count end |
#expired_at ⇒ Object
Returns the value of attribute expired_at
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def expired_at @expired_at end |
#finished_at ⇒ Object
Returns the value of attribute finished_at
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def finished_at @finished_at end |
#id ⇒ Object
Returns the value of attribute id
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def id @id end |
#job_class ⇒ Object
Returns the value of attribute job_class
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def job_class @job_class end |
#last_error_backtrace ⇒ Object
Returns the value of attribute last_error_backtrace
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def last_error_backtrace @last_error_backtrace end |
#last_error_message ⇒ Object
Returns the value of attribute last_error_message
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def @last_error_message end |
#priority ⇒ Object
Returns the value of attribute priority
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def priority @priority end |
#queue ⇒ Object
Returns the value of attribute queue
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def queue @queue end |
#run_at ⇒ Object
Returns the value of attribute run_at
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def run_at @run_at end |
Instance Method Details
#humanized_job_class ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/que/web/viewmodels/job.rb', line 17 def humanized_job_class case job_class when "ActiveJob::QueueAdapters::QueAdapter::JobWrapper" args.first[:job_class] else job_class end end |
#past_due?(relative_to = Time.now) ⇒ Boolean
13 14 15 |
# File 'lib/que/web/viewmodels/job.rb', line 13 def past_due?(relative_to = Time.now) run_at < relative_to end |