lib/gush/job.rb in gush-0.1.2 vs lib/gush/job.rb in gush-0.2.0
- old
+ new
@@ -58,26 +58,30 @@
def fail!
@finished_at = @failed_at = current_timestamp
end
def enqueued?
- !!enqueued_at
+ !enqueued_at.nil?
end
def finished?
- !!finished_at
+ !finished_at.nil?
end
def failed?
- !!failed_at
+ !failed_at.nil?
end
def succeeded?
finished? && !failed?
end
+ def started?
+ !started_at.nil?
+ end
+
def running?
- !!started_at && !finished?
+ started? && !finished?
end
def ready_to_start?
!running? && !enqueued? && !finished? && !failed?
end