Class: Result
- Inherits:
-
Object
- Object
- Result
- Defined in:
- lib/linh/result.rb
Instance Method Summary collapse
-
#initialize(bmi) ⇒ Result
constructor
A new instance of Result.
- #put ⇒ Object
Constructor Details
#initialize(bmi) ⇒ Result
Returns a new instance of Result.
2 3 4 |
# File 'lib/linh/result.rb', line 2 def initialize(bmi) @bmi = bmi end |
Instance Method Details
#put ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/linh/result.rb', line 6 def put case @bmi when 0 .. 15 puts "Very severely underweight" when 15 .. 16 puts "Severely underweight" when 16 .. 18.5 puts "Underweight" when 18.5 .. 25 puts "Normal" when 25 .. 30 puts "Overweight" else puts "Obese Class" end end |