Sha256: 5d7a6f2637696cb883711e7ed844186b481d8f438ef59cc6a75d0114b85e1cce

Contents?: true

Size: 959 Bytes

Versions: 131

Compression:

Stored size: 959 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware"

module Renalware
  module PD
    def self.table_name_prefix
      "pd_"
    end

    def self.cast_patient(patient)
      ActiveType.cast(patient, ::Renalware::PD::Patient)
    end

    # PD-specific configuration
    #
    # You can override default settings here in an initializer in the host app like so:
    #   Renalware::PD.configure do |config|
    #     config.delivery_intervals = [2.days, 1.week, 3.weeks, 1.year]
    #   end
    #
    #  You can access PD configuration like so
    #    Renalware::PD.config.delivery_intervals
    #
    class Configuration
      include ActiveSupport::Configurable

      config_accessor(:delivery_intervals) { [1.week, 2.weeks, 3.weeks, 4.weeks] }

      config_accessor(:training_durations) { (1..15).map(&:days) }
    end

    def self.config
      @config ||= Configuration.new
    end

    def self.configure
      yield config
    end
  end
end

Version data entries

131 entries across 131 versions & 1 rubygems

Version Path
renalware-core-2.0.149 app/models/renalware/pd.rb
renalware-core-2.0.148 app/models/renalware/pd.rb
renalware-core-2.0.147 app/models/renalware/pd.rb
renalware-core-2.0.146 app/models/renalware/pd.rb
renalware-core-2.0.145 app/models/renalware/pd.rb
renalware-core-2.0.144 app/models/renalware/pd.rb
renalware-core-2.0.143 app/models/renalware/pd.rb
renalware-core-2.0.142 app/models/renalware/pd.rb
renalware-core-2.0.141 app/models/renalware/pd.rb
renalware-core-2.0.140 app/models/renalware/pd.rb
renalware-core-2.0.139 app/models/renalware/pd.rb
renalware-core-2.0.138 app/models/renalware/pd.rb
renalware-core-2.0.137 app/models/renalware/pd.rb
renalware-core-2.0.136 app/models/renalware/pd.rb
renalware-core-2.0.135 app/models/renalware/pd.rb
renalware-core-2.0.134 app/models/renalware/pd.rb
renalware-core-2.0.133 app/models/renalware/pd.rb
renalware-core-2.0.132 app/models/renalware/pd.rb
renalware-core-2.0.131 app/models/renalware/pd.rb
renalware-core-2.0.130 app/models/renalware/pd.rb