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

Returns a new instance of NoAccessionService.



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

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

Instance Method Details

#providerObject



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

def provider
  :NONE
end

#submit(_user, *_accessionables) ⇒ Object



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

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



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

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



31
32
33
34
# File 'app/models/no_accession_service.rb', line 31

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



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

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



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

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