Class: GemaPeso
- Inherits:
-
Object
- Object
- GemaPeso
- Defined in:
- lib/bmi-Gionani.rb
Instance Attribute Summary collapse
-
#altura ⇒ Object
Returns the value of attribute altura.
-
#peso ⇒ Object
Returns the value of attribute peso.
Instance Method Summary collapse
- #calcularpeso ⇒ Object
-
#initialize(peso, altura) ⇒ GemaPeso
constructor
A new instance of GemaPeso.
Constructor Details
#initialize(peso, altura) ⇒ GemaPeso
Returns a new instance of GemaPeso.
4 5 6 7 |
# File 'lib/bmi-Gionani.rb', line 4 def initialize(peso, altura) @weight=peso @height=altura end |
Instance Attribute Details
#altura ⇒ Object
Returns the value of attribute altura.
2 3 4 |
# File 'lib/bmi-Gionani.rb', line 2 def altura @altura end |
#peso ⇒ Object
Returns the value of attribute peso.
2 3 4 |
# File 'lib/bmi-Gionani.rb', line 2 def peso @peso end |
Instance Method Details
#calcularpeso ⇒ Object
9 10 11 12 |
# File 'lib/bmi-Gionani.rb', line 9 def calcularpeso @masa = @weight / (@height * @height) puts 'Su masa corporal es: '+ @masa.to_s end |