Class: Kronos::Report
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Kronos::Report
- Defined in:
- lib/kronos/report.rb
Constant Summary collapse
- STATUSES =
{ success: 0, failure: 1 }.freeze
Class Method Summary collapse
- .failure_from(task_id, exception, timestamp = Time.now) ⇒ Object
- .success_from(task_id, metadata, timestamp = Time.now) ⇒ Object
Instance Method Summary collapse
Class Method Details
.failure_from(task_id, exception, timestamp = Time.now) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/kronos/report.rb', line 17 def failure_from(task_id, exception, = Time.now) new( task_id: check_task_id(task_id), status: Kronos::Report::STATUSES[:failure], timestamp: (), exception: check_exception(exception) ) end |