Class: Dor::Workflow::Client::VersionRoutes
- Inherits:
-
Object
- Object
- Dor::Workflow::Client::VersionRoutes
- Defined in:
- lib/dor/workflow/client/version_routes.rb
Overview
Makes requests relating to versions
Instance Method Summary collapse
-
#close_version(repo, druid, create_accession_wf = true) ⇒ Object
Calls the versionClose endpoint of the workflow service:.
-
#initialize(requestor:) ⇒ VersionRoutes
constructor
A new instance of VersionRoutes.
Constructor Details
#initialize(requestor:) ⇒ VersionRoutes
Returns a new instance of VersionRoutes.
8 9 10 |
# File 'lib/dor/workflow/client/version_routes.rb', line 8 def initialize(requestor:) @requestor = requestor end |
Instance Method Details
#close_version(repo, druid, create_accession_wf = true) ⇒ Object
Calls the versionClose endpoint of the workflow service:
- completes the versioningWF:submit-version and versioningWF:start-accession steps
- initiates accesssionWF
20 21 22 23 24 25 |
# File 'lib/dor/workflow/client/version_routes.rb', line 20 def close_version(repo, druid, create_accession_wf = true) uri = "#{repo}/objects/#{druid}/versionClose" uri += '?create-accession=false' unless create_accession_wf requestor.request(uri, 'post', '') true end |