Class: Dor::StateService
- Inherits:
-
Object
- Object
- Dor::StateService
- Extended by:
- Deprecation
- Defined in:
- lib/dor/services/state_service.rb
Instance Method Summary collapse
- #allows_modification? ⇒ Boolean
-
#initialize(pid, version: nil) ⇒ StateService
constructor
having version is preferred as without it, a call to fedora will be made to retrieve it.
Constructor Details
#initialize(pid, version: nil) ⇒ StateService
having version is preferred as without it, a call to fedora will be made to retrieve it.
9 10 11 12 13 |
# File 'lib/dor/services/state_service.rb', line 9 def initialize(pid, version: nil) Deprecation.warn(self, 'Dor::StateService is deprecated and will be removed in dor-services 9') @pid = pid @version = version || fetch_version end |
Instance Method Details
#allows_modification? ⇒ Boolean
15 16 17 18 19 |
# File 'lib/dor/services/state_service.rb', line 15 def allows_modification? !client.lifecycle('dor', pid, 'submitted') || client.active_lifecycle('dor', pid, 'opened', version: version) || client.workflow_status('dor', pid, 'accessionWF', 'sdr-ingest-transfer') == 'hold' end |