Class: Renalware::PD::APD::GlucoseCalculator
- Inherits:
-
Object
- Object
- Renalware::PD::APD::GlucoseCalculator
- Defined in:
- app/models/renalware/pd/apd/glucose_calculator.rb
Instance Attribute Summary collapse
-
#bags ⇒ Object
readonly
Returns the value of attribute bags.
-
#regime ⇒ Object
readonly
Returns the value of attribute regime.
Instance Method Summary collapse
-
#glucose_content ⇒ Object
See calculating_apd_volumes.feature for a description of the algorithm here.
-
#initialize(regime:, strength:) ⇒ GlucoseCalculator
constructor
A new instance of GlucoseCalculator.
Constructor Details
#initialize(regime:, strength:) ⇒ GlucoseCalculator
Returns a new instance of GlucoseCalculator.
12 13 14 15 |
# File 'app/models/renalware/pd/apd/glucose_calculator.rb', line 12 def initialize(regime:, strength:) @regime = regime @bags = bags_having_glucose_strength(regime.bags, strength) end |
Instance Attribute Details
#bags ⇒ Object (readonly)
Returns the value of attribute bags.
9 10 11 |
# File 'app/models/renalware/pd/apd/glucose_calculator.rb', line 9 def bags @bags end |
#regime ⇒ Object (readonly)
Returns the value of attribute regime.
9 10 11 |
# File 'app/models/renalware/pd/apd/glucose_calculator.rb', line 9 def regime @regime end |
Instance Method Details
#glucose_content ⇒ Object
See calculating_apd_volumes.feature for a description of the algorithm here.
18 19 20 |
# File 'app/models/renalware/pd/apd/glucose_calculator.rb', line 18 def glucose_content overnight_glucose_content + other_glucose_content end |