Class: NoAccessionService

Inherits:
AccessionService show all
Defined in:
app/models/no_accession_service.rb

Constant Summary

Constants inherited from AccessionService

AccessionService::AccessionServiceError, AccessionService::CenterName, AccessionService::Hold, AccessionService::NumberNotGenerated, AccessionService::NumberNotRequired, AccessionService::Protect

Instance Method Summary collapse

Methods inherited from AccessionService

#accession_dac_xml, #accession_policy_xml, #accession_sample_xml, #accession_study_xml, #dac_visibility, #policy_visibility, #private?, #sample_visibility, #study_visibility

Constructor Details

#initialize(study) ⇒ NoAccessionService


4
5
6
# File 'app/models/no_accession_service.rb', line 4

def initialize(study)
  @study_id = study.id
end

Instance Method Details

#providerObject


8
# File 'app/models/no_accession_service.rb', line 8

def provider; :NONE end

#submit(_user, *_accessionables) ⇒ Object


10
11
12
# File 'app/models/no_accession_service.rb', line 10

def submit(_user, *_accessionables)
  raise AccessionService::NumberNotRequired, I18n.t(:not_applicable_study, scope: 'accession_service.not_required')
end

#submit_dac_for_user(_study, _user) ⇒ Object


22
23
24
# File 'app/models/no_accession_service.rb', line 22

def submit_dac_for_user(_study, _user)
  raise AccessionService::NumberNotRequired, I18n.t(:not_applicable_study_for_dac, scope: 'accession_service.not_required')
end

#submit_policy_for_user(_user, _study) ⇒ Object


26
27
28
# File 'app/models/no_accession_service.rb', line 26

def submit_policy_for_user(_user, _study)
  raise AccessionService::NumberNotRequired, I18n.t(:not_applicable_study_for_dac, scope: 'accession_service.not_required')
end

#submit_sample_for_user(_sample, _user) ⇒ Object


14
15
16
# File 'app/models/no_accession_service.rb', line 14

def submit_sample_for_user(_sample, _user)
  raise AccessionService::NumberNotRequired, I18n.t(:not_applicable_study_for_sample, scope: 'accession_service.not_required', study_id: @study_id)
end

#submit_study_for_user(_study, _user) ⇒ Object


18
19
20
# File 'app/models/no_accession_service.rb', line 18

def submit_study_for_user(_study, _user)
  raise AccessionService::NumberNotRequired, I18n.t(:not_applicable_study, scope: 'accession_service.not_required')
end