Sha256: fe35448b8c44db0bf6018a2d6c5baa69b8a550796bdcb5d2a76b310cee33225d

Contents?: true

Size: 928 Bytes

Versions: 20

Compression:

Stored size: 928 Bytes

Contents

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

20 entries across 20 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/pd.rb
renalware-core-2.0.7 app/models/renalware/pd.rb
renalware-core-2.0.5 app/models/renalware/pd.rb
renalware-core-2.0.4 app/models/renalware/pd.rb
renalware-core-2.0.3 app/models/renalware/pd.rb
renalware-core-2.0.2 app/models/renalware/pd.rb
renalware-core-2.0.1 app/models/renalware/pd.rb
renalware-core-2.0.0 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc11 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.rc1 app/models/renalware/pd.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/pd.rb