Class: Dor::Services::Client::ObjectWorkflows
- Inherits:
-
VersionedService
- Object
- VersionedService
- Dor::Services::Client::ObjectWorkflows
- Defined in:
- lib/dor/services/client/object_workflows.rb
Overview
API calls around workflows for an object.
Constant Summary
Constants inherited from VersionedService
VersionedService::EXCEPTION_CLASS, VersionedService::JSON_API_MIME_TYPE
Instance Method Summary collapse
-
#initialize(connection:, version:, object_identifier:) ⇒ ObjectWorkflows
constructor
A new instance of ObjectWorkflows.
-
#list ⇒ Dor::Services::Response::Workflows
Retrieves all workflows for the given object.
Methods inherited from VersionedService
Constructor Details
#initialize(connection:, version:, object_identifier:) ⇒ ObjectWorkflows
Returns a new instance of ObjectWorkflows.
9 10 11 12 |
# File 'lib/dor/services/client/object_workflows.rb', line 9 def initialize(connection:, version:, object_identifier:) super(connection: connection, version: version) @object_identifier = object_identifier end |
Instance Method Details
#list ⇒ Dor::Services::Response::Workflows
Retrieves all workflows for the given object
16 17 18 19 20 21 22 23 24 |
# File 'lib/dor/services/client/object_workflows.rb', line 16 def list resp = connection.get do |req| req.url "#{api_version}/objects/#{object_identifier}/workflows" req.headers['Accept'] = 'application/xml' end raise_exception_based_on_response!(resp) unless resp.success? Dor::Services::Response::Workflows.new(xml: Nokogiri::XML(resp.body)) end |