Sha256: c2b94e25fb71ae467d81affb6da9532a3724d83e6015312ff2bfc98bf6770b6d
Contents?: true
Size: 885 Bytes
Versions: 95
Compression:
Stored size: 885 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/events" module Renalware module Events class EventPdfPresenter < SimpleDelegator class DefaultHospitalCentreNotFoundError < StandardError; end class DefaultHospitalCentreNotSetError < StandardError; end delegate :info, :trust_name, :trust_caption, to: :hospital_centre, prefix: true, allow_nil: true private def hospital_centre @hospital_centre ||= begin centre = Renalware::Hospitals::Centre.find_by(code: default_hospital_centre_code) centre.presence || raise(DefaultHospitalCentreNotFoundError, default_hospital_centre_code) end end def default_hospital_centre_code Renalware.config.ukrdc_site_code.presence || raise(DefaultHospitalCentreNotSetError) end end end end
Version data entries
95 entries across 95 versions & 1 rubygems