Class: Dor::Services::Response::Workflows
- Inherits:
-
Object
- Object
- Dor::Services::Response::Workflows
- Defined in:
- lib/dor/services/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 specified 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.
11 12 13 |
# File 'lib/dor/services/response/workflows.rb', line 11 def initialize(xml:) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
8 9 10 |
# File 'lib/dor/services/response/workflows.rb', line 8 def xml @xml end |
Instance Method Details
#errors_for(version:) ⇒ Array<String>
Returns a list of errors for any process for the specified version
26 27 28 |
# File 'lib/dor/services/response/workflows.rb', line 26 def errors_for(version:) xml.xpath("//workflow/process[@version='#{version}' and @status='error']/@errorMessage").map(&:text) end |
#pid ⇒ Object
15 16 17 |
# File 'lib/dor/services/response/workflows.rb', line 15 def pid xml.at_xpath('/workflows/@objectId').text end |