Class: GemaPeso

Inherits:
Object
  • Object
show all
Defined in:
lib/bmi-Gionani.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#alturaObject

Returns the value of attribute altura.



2
3
4
# File 'lib/bmi-Gionani.rb', line 2

def altura
  @altura
end

#pesoObject

Returns the value of attribute peso.



2
3
4
# File 'lib/bmi-Gionani.rb', line 2

def peso
  @peso
end

Instance Method Details

#calcularpesoObject



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