Class: Dor::Workflow::Response::Process
- Inherits:
-
Object
- Object
- Dor::Workflow::Response::Process
- Extended by:
- Deprecation
- Defined in:
- lib/dor/workflow/response/process.rb
Overview
Represents the status of an object doing a workflow process
Instance Method Summary collapse
- #attempts ⇒ Object
-
#context ⇒ Hash
The context for the process (or empty hash if none present).
- #datetime ⇒ Object
- #elapsed ⇒ Object
- #error_message ⇒ Object
-
#initialize(parent:, **attributes) ⇒ Process
constructor
A new instance of Process.
- #lane_id ⇒ Object
- #lifecycle ⇒ Object
- #name ⇒ Object
- #note ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(parent:, **attributes) ⇒ Process
Returns a new instance of Process.
13 14 15 16 |
# File 'lib/dor/workflow/response/process.rb', line 13 def initialize(parent:, **attributes) @parent = parent @attributes = attributes end |
Instance Method Details
#attempts ⇒ Object
34 35 36 |
# File 'lib/dor/workflow/response/process.rb', line 34 def attempts @attributes[:attempts].presence end |
#context ⇒ Hash
Returns the context for the process (or empty hash if none present).
55 56 57 58 59 |
# File 'lib/dor/workflow/response/process.rb', line 55 def context return {} unless @attributes[:context].present? JSON.parse(@attributes[:context]) end |
#datetime ⇒ Object
26 27 28 |
# File 'lib/dor/workflow/response/process.rb', line 26 def datetime @attributes[:datetime].presence end |
#elapsed ⇒ Object
30 31 32 |
# File 'lib/dor/workflow/response/process.rb', line 30 def elapsed @attributes[:elapsed].presence end |
#error_message ⇒ Object
46 47 48 |
# File 'lib/dor/workflow/response/process.rb', line 46 def @attributes[:errorMessage].presence end |
#lane_id ⇒ Object
50 51 52 |
# File 'lib/dor/workflow/response/process.rb', line 50 def lane_id @attributes[:laneId].presence end |
#lifecycle ⇒ Object
38 39 40 |
# File 'lib/dor/workflow/response/process.rb', line 38 def lifecycle @attributes[:lifecycle].presence end |
#name ⇒ Object
18 19 20 |
# File 'lib/dor/workflow/response/process.rb', line 18 def name @attributes[:name].presence end |
#note ⇒ Object
42 43 44 |
# File 'lib/dor/workflow/response/process.rb', line 42 def note @attributes[:note].presence end |
#status ⇒ Object
22 23 24 |
# File 'lib/dor/workflow/response/process.rb', line 22 def status @attributes[:status].presence end |