Sha256: 5f2400e02f3532036f58a746ee28d144c4c5289a75e8ae76cf5ef2d77ed4565f
Contents?: true
Size: 620 Bytes
Versions: 14
Compression:
Stored size: 620 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/ukrdc" require "attr_extras" require "benchmark" module Renalware module UKRDC module TreatmentTimeline class GeneratorFactory DEFAULT_TYPE = "Generic" # Each modality_description has a :code fiekd def self.call(modality) type = modality.description.code&.to_s&.camelize (klass_for(type) || klass_for(DEFAULT_TYPE)).new(modality) end def self.klass_for(type) "Renalware::UKRDC::TreatmentTimeline::#{type}::Generator".safe_constantize end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems