Class: Dor::Workflow::Response::Workflows
- Inherits:
-
Object
- Object
- Dor::Workflow::Response::Workflows
- Defined in:
- lib/dor/workflow/response/workflows.rb
Overview
The response from asking the server about all workflows for an item
Instance Attribute Summary collapse
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
-
#errors_for(version:) ⇒ Array<String>
Returns a list of errors for any process for the current version.
-
#initialize(xml:) ⇒ Workflows
constructor
A new instance of Workflows.
- #pid ⇒ Object
- #workflows ⇒ Object
Constructor Details
#initialize(xml:) ⇒ Workflows
Returns a new instance of Workflows.
8 9 10 |
# File 'lib/dor/workflow/response/workflows.rb', line 8 def initialize(xml:) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
28 29 30 |
# File 'lib/dor/workflow/response/workflows.rb', line 28 def xml @xml end |
Instance Method Details
#errors_for(version:) ⇒ Array<String>
Returns a list of errors for any process for the current version
23 24 25 26 |
# File 'lib/dor/workflow/response/workflows.rb', line 23 def errors_for(version:) ng_xml.xpath("//workflow/process[@version='#{version}' and @status='error']/@errorMessage") .map(&:text) end |
#pid ⇒ Object
12 13 14 |
# File 'lib/dor/workflow/response/workflows.rb', line 12 def pid ng_xml.at_xpath('/workflows/@objectId').text end |