Class: EVSS::Letters::DownloadService
- Inherits:
-
Service
- Object
- Common::Client::Base
- Service
- EVSS::Letters::DownloadService
- Includes:
- Common::Client::Concerns::Monitoring
- Defined in:
- lib/evss/letters/download_service.rb
Overview
Proxy Service for Letters Download Caseflow
Constant Summary
Constants inherited from Service
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#download_letter(type, options = nil) ⇒ String
Downloads a letter for a user.
Methods included from Common::Client::Concerns::Monitoring
Methods inherited from Service
#headers, #initialize, #perform, service_is_up?
Methods inherited from Common::Client::Base
configuration, #raise_backend_exception
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Constructor Details
This class inherits a constructor from EVSS::Service
Instance Method Details
#download_letter(type, options = nil) ⇒ String
Downloads a letter for a user
one of EVSS::Letters::Letter::LETTER_TYPES
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/evss/letters/download_service.rb', line 28 def download_letter(type, = nil) with_monitoring do response = if .blank? download(type) else (type, ) end case response.status.to_i when 200 response.body when 404 raise Common::Exceptions::RecordNotFound, type else Raven.extra_context( url: config.base_path, body: response.body ) raise_backend_exception('EVSS502', 'Letters') end end end |