Class: Dor::Services::Client::Workflows
- Inherits:
-
VersionedService
- Object
- VersionedService
- Dor::Services::Client::Workflows
- Defined in:
- lib/dor/services/client/workflows.rb
Overview
API calls around workflows in DOR
Constant Summary
Constants inherited from VersionedService
VersionedService::EXCEPTION_CLASS, VersionedService::JSON_API_MIME_TYPE
Instance Method Summary collapse
-
#template(workflow_name) ⇒ Hash
Retrieves a workflow template given a workflow name.
-
#templates ⇒ Array<String>
Retrieves a list of workflow template name.
Methods inherited from VersionedService
Constructor Details
This class inherits a constructor from Dor::Services::Client::VersionedService
Instance Method Details
#template(workflow_name) ⇒ Hash
Retrieves a workflow template given a workflow name
22 23 24 25 26 27 28 29 30 |
# File 'lib/dor/services/client/workflows.rb', line 22 def template(workflow_name) resp = connection.get do |req| req.url "#{api_version}/workflow_templates/#{workflow_name}" req.headers['Accept'] = 'application/json' end raise_exception_based_on_response!(resp) unless resp.success? JSON.parse(resp.body) end |
#templates ⇒ Array<String>
Retrieves a list of workflow template name
10 11 12 13 14 15 16 17 18 |
# File 'lib/dor/services/client/workflows.rb', line 10 def templates resp = connection.get do |req| req.url "#{api_version}/workflow_templates" req.headers['Accept'] = 'application/json' end raise_exception_based_on_response!(resp) unless resp.success? JSON.parse(resp.body) end |