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.
-
#error_count ⇒ Object
Returns the value of attribute error_count.
-
#job_class ⇒ Object
Returns the value of attribute job_class.
-
#job_id ⇒ Object
Returns the value of attribute job_id.
-
#last_error ⇒ Object
Returns the value of attribute last_error.
-
#pg_backend_pid ⇒ Object
Returns the value of attribute pg_backend_pid.
-
#pg_last_query ⇒ Object
Returns the value of attribute pg_last_query.
-
#pg_last_query_started_at ⇒ Object
Returns the value of attribute pg_last_query_started_at.
-
#pg_state ⇒ Object
Returns the value of attribute pg_state.
-
#pg_state_changed_at ⇒ Object
Returns the value of attribute pg_state_changed_at.
-
#pg_transaction_started_at ⇒ Object
Returns the value of attribute pg_transaction_started_at.
-
#pg_waiting_on_lock ⇒ Object
Returns the value of attribute pg_waiting_on_lock.
-
#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
-
#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.
8 9 10 11 12 |
# File 'lib/que/web/viewmodels/job.rb', line 8 def initialize(job) members.each do |m| self[m] = job[m.to_s] 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 |
#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 |
#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 |
#job_id ⇒ Object
Returns the value of attribute job_id
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def job_id @job_id end |
#last_error ⇒ Object
Returns the value of attribute last_error
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def last_error @last_error end |
#pg_backend_pid ⇒ Object
Returns the value of attribute pg_backend_pid
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def pg_backend_pid @pg_backend_pid end |
#pg_last_query ⇒ Object
Returns the value of attribute pg_last_query
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def pg_last_query @pg_last_query end |
#pg_last_query_started_at ⇒ Object
Returns the value of attribute pg_last_query_started_at
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def pg_last_query_started_at @pg_last_query_started_at end |
#pg_state ⇒ Object
Returns the value of attribute pg_state
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def pg_state @pg_state end |
#pg_state_changed_at ⇒ Object
Returns the value of attribute pg_state_changed_at
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def pg_state_changed_at @pg_state_changed_at end |
#pg_transaction_started_at ⇒ Object
Returns the value of attribute pg_transaction_started_at
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def pg_transaction_started_at @pg_transaction_started_at end |
#pg_waiting_on_lock ⇒ Object
Returns the value of attribute pg_waiting_on_lock
2 3 4 |
# File 'lib/que/web/viewmodels/job.rb', line 2 def pg_waiting_on_lock @pg_waiting_on_lock 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
#past_due?(relative_to = Time.now) ⇒ Boolean
14 15 16 |
# File 'lib/que/web/viewmodels/job.rb', line 14 def past_due?(relative_to = Time.now) run_at < relative_to end |