Class: RubynCode::Background::Job
- Inherits:
-
Data
- Object
- Data
- RubynCode::Background::Job
- Defined in:
- lib/rubyn_code/background/job.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#completed_at ⇒ Object
readonly
Returns the value of attribute completed_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command
5 6 7 |
# File 'lib/rubyn_code/background/job.rb', line 5 def command @command end |
#completed_at ⇒ Object (readonly)
Returns the value of attribute completed_at
5 6 7 |
# File 'lib/rubyn_code/background/job.rb', line 5 def completed_at @completed_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id
5 6 7 |
# File 'lib/rubyn_code/background/job.rb', line 5 def id @id end |
#result ⇒ Object (readonly)
Returns the value of attribute result
5 6 7 |
# File 'lib/rubyn_code/background/job.rb', line 5 def result @result end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at
5 6 7 |
# File 'lib/rubyn_code/background/job.rb', line 5 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status
5 6 7 |
# File 'lib/rubyn_code/background/job.rb', line 5 def status @status end |
Instance Method Details
#completed? ⇒ Boolean
7 |
# File 'lib/rubyn_code/background/job.rb', line 7 def completed? = status == :completed |
#duration ⇒ Object
11 12 13 14 15 16 |
# File 'lib/rubyn_code/background/job.rb', line 11 def duration return nil unless started_at return nil if running? (completed_at || Time.now) - started_at end |
#error? ⇒ Boolean
8 |
# File 'lib/rubyn_code/background/job.rb', line 8 def error? = status == :error |
#running? ⇒ Boolean
6 |
# File 'lib/rubyn_code/background/job.rb', line 6 def running? = status == :running |
#timeout? ⇒ Boolean
9 |
# File 'lib/rubyn_code/background/job.rb', line 9 def timeout? = status == :timeout |