Class: IvCalculator
- Inherits:
-
Object
- Object
- IvCalculator
- Defined in:
- lib/Ivfcalc.rb
Class Method Summary collapse
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(volume, time, drop_factor) ⇒ IvCalculator
constructor
A new instance of IvCalculator.
Constructor Details
#initialize(volume, time, drop_factor) ⇒ IvCalculator
Returns a new instance of IvCalculator.
3 4 5 6 7 8 9 10 |
# File 'lib/Ivfcalc.rb', line 3 def initialize(volume ,time , drop_factor) @volume = volume @time = time @drop_factor = drop_factor end |
Class Method Details
.calculate(volume, time, drop_factor) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/Ivfcalc.rb', line 12 def self.calculate(volume,time,drop_factor) @volume = volume @time = time @drop_factor = drop_factor @calculate = (@volume * @time) / @drop_factor.to_f if @calculate > 0 result = true else result = false end return result end |
Instance Method Details
#details ⇒ Object
33 34 35 36 37 38 |
# File 'lib/Ivfcalc.rb', line 33 def details @calculate = (@volume * @time) / @drop_factor return "The IV flow rate is -->" + @calculate.to_s + "gtts/min" end |