Class: UnsuitableAccessionService
Overview
Used for samples/studies which are neither open or managed.
Constant Summary
AccessionService::AccessionServiceError, AccessionService::CenterName, AccessionService::Hold, AccessionService::NumberNotGenerated, AccessionService::NumberNotRequired, AccessionService::Protect
Instance Method Summary
collapse
#accession_dac_xml, #accession_policy_xml, #accession_sample_xml, #accession_study_xml, #dac_visibility, #policy_visibility, #private?, #sample_visibility, #study_visibility
Constructor Details
Returns a new instance of UnsuitableAccessionService.
6
7
8
|
# File 'app/models/unsuitable_accession_service.rb', line 6
def initialize(studies)
@study_ids = studies.map(&:id)
end
|
Instance Method Details
#provider ⇒ Object
10
11
12
|
# File 'app/models/unsuitable_accession_service.rb', line 10
def provider
:unsuitable
end
|
#submit(_user, *_accessionables) ⇒ Object
14
15
16
17
|
# File 'app/models/unsuitable_accession_service.rb', line 14
def submit(_user, *_accessionables)
raise AccessionService::NumberNotGenerated,
I18n.t(:no_suitable_study, scope: 'accession_service.unsuitable', study_ids: @study_ids.to_sentence)
end
|
#submit_dac_for_user(_study, _user) ⇒ Object
31
32
33
34
35
36
|
# File 'app/models/unsuitable_accession_service.rb', line 31
def submit_dac_for_user(_study, _user)
raise StandardError,
'UnsuitableAccessionService should only be used for samples. This is a problem with Sequencescape and should be reported.'
end
|
#submit_sample_for_user(_sample, _user) ⇒ Object
19
20
21
22
|
# File 'app/models/unsuitable_accession_service.rb', line 19
def submit_sample_for_user(_sample, _user)
raise AccessionService::NumberNotGenerated,
I18n.t(:no_suitable_study, scope: 'accession_service.unsuitable', study_ids: @study_ids.to_sentence)
end
|
#submit_study_for_user(_study, _user) ⇒ Object
24
25
26
27
28
29
|
# File 'app/models/unsuitable_accession_service.rb', line 24
def submit_study_for_user(_study, _user)
raise StandardError,
'UnsuitableAccessionService should only be used for samples. This is a problem with Sequencescape and should be reported.'
end
|