Class: Renalware::PD::CAPDRegime::GlucoseStrength

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/pd/capd_regime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGlucoseStrength

Returns a new instance of GlucoseStrength.



58
59
60
# File 'app/models/renalware/pd/capd_regime.rb', line 58

def initialize
  @weekly_totals = []
end

Instance Attribute Details

#weekly_totalsObject (readonly)

Returns the value of attribute weekly_totals.



56
57
58
# File 'app/models/renalware/pd/capd_regime.rb', line 56

def weekly_totals
  @weekly_totals
end

Instance Method Details

#daily_averageObject



62
63
64
65
# File 'app/models/renalware/pd/capd_regime.rb', line 62

def daily_average
  per_week_total = weekly_totals.inject(0.0){ |sum, volume| sum + volume }
  per_week_total / 7.to_f
end