class Individuos

Constants

VERSION

Attributes

nombre[R]
paciente[R]
tratamiento[R]

Public Class Methods

new(nombre, paciente, tratamiento, peso, talla, edad, sexo, f_af) click to toggle source
Calls superclass method IMC::new
# File lib/NutrientesEdu/Individuo.rb, line 9
def initialize(nombre, paciente, tratamiento, peso, talla, edad, sexo, f_af)
    @nombre=nombre
    @paciente=paciente
    @tratamiento=tratamiento
    @f_af=f_af
    @peso=peso
    @talla=talla
    @edad=edad
    @sexo=sexo
    if @paciente==1
        super(peso,talla,edad,sexo)
    end
end

Public Instance Methods

clas_imc() click to toggle source
# File lib/NutrientesEdu/Individuo.rb, line 23
def clas_imc
    if calcular_imc < 30
        return "Normal"
    else
        return "Obeso"
    end
end
e_term() click to toggle source
# File lib/NutrientesEdu/Individuo.rb, line 39
def e_term
    return g_e_basal*0.10
end
g_act_fis() click to toggle source
# File lib/NutrientesEdu/Individuo.rb, line 43
def g_act_fis
    return g_e_basal*@f_af
end
g_e_basal() click to toggle source
# File lib/NutrientesEdu/Individuo.rb, line 31
def g_e_basal
    if(@sexo == 0)
        return 10*@peso+6.25*@talla-5*@edad-161
    else
        return 10*@peso+6.25*@talla-5*@edad+5
    end
end
g_en_total() click to toggle source
# File lib/NutrientesEdu/Individuo.rb, line 47
def g_en_total
    return g_e_basal+e_term+g_act_fis
end
to_s() click to toggle source
Calls superclass method IMC#to_s
# File lib/NutrientesEdu/Individuo.rb, line 52
def to_s
    rval = "#{@nombre} #{g_en_total}"
    if(@tratamiento == 1)
        rval += super
    end
    return rval
end