Sha256: 7c268c15863fdaeb905ab050d823cb9c1d0c99c9b9e75f5c49c4dece03f03068

Contents?: true

Size: 939 Bytes

Versions: 1

Compression:

Stored size: 939 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{ |day| day.days } }

    end

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

    def self.configure
      yield config
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta4 app/models/renalware/pd.rb