Class: ActiveJobStatus::JobStatus
- Inherits:
-
Object
- Object
- ActiveJobStatus::JobStatus
- Defined in:
- lib/active_job_status/job_status.rb
Constant Summary collapse
- ENQUEUED =
:queued
- WORKING =
:working
- COMPLETED =
:completed
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #completed? ⇒ Boolean
- #empty? ⇒ Boolean
-
#initialize(status) ⇒ JobStatus
constructor
A new instance of JobStatus.
- #queued? ⇒ Boolean
- #working? ⇒ Boolean
Constructor Details
#initialize(status) ⇒ JobStatus
Returns a new instance of JobStatus.
9 10 11 |
# File 'lib/active_job_status/job_status.rb', line 9 def initialize(status) @status = status && status.to_sym end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/active_job_status/job_status.rb', line 7 def status @status end |
Instance Method Details
#completed? ⇒ Boolean
21 22 23 |
# File 'lib/active_job_status/job_status.rb', line 21 def completed? status == COMPLETED end |
#empty? ⇒ Boolean
25 26 27 |
# File 'lib/active_job_status/job_status.rb', line 25 def empty? status.nil? end |
#queued? ⇒ Boolean
13 14 15 |
# File 'lib/active_job_status/job_status.rb', line 13 def queued? status == ENQUEUED end |
#working? ⇒ Boolean
17 18 19 |
# File 'lib/active_job_status/job_status.rb', line 17 def working? status == WORKING end |